Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

opencv-wasm

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opencv-wasm

Precompiled OpenCV 4.3.0 to JavaScript + WebAssembly for node.js environment

  • 4.3.0-5
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

OpenCV-WASM

Build Status

Precompiled OpenCV 4.3.0 to JavaScript + WebAssembly for node.js environment.

In this WASM-compiled OpenCV, there's no need to have OpenCV installed in the machine or using node-gyp. The entire OpenCV library is already inside this package (opencv.js and opencv.wasm).

Examples

CodeInputOutput
dilation.jsimage sample 1dilation
templateMatching.jssource:
image sample 2
template:
image sample 2 template
template matching

Installation

npm install opencv-wasm

Usage

Because this module is using (almost) the same code as the official OpenCV.js for the web, you can use the same documentation at the web: https://docs.opencv.org/4.3.0/d5/d10/tutorial_js_root.html

There are some minor initialization changes, because this module will be loaded synchronously instead of the OpenCV's default (asynchronously).

You can check the files inside examples folder as reference on how to initialize, loading images, and saving images.

Error Handling

By default, mistakes in code will produce error code. You can use the following snippet to translate the error code into meaningful statement from OpenCV.

const { cv, cvTranslateError } = require('opencv-wasm');

try {
    // Your OpenCV code
} catch (err) {
    console.log(cvTranslateError(cv, err));
}

Versioning

This npm module uses the following versioning number:

<opencv version>-<this module version>

For Example

4.3.0-1
OpenCV version 4.3.0
OpenCV-WASM Module version 1

Development

Building

Run the following script on macOS or Linux (tested on Ubuntu). You need docker on the system.

npm install
cd ./utils
sh ./build.sh
cd ..

Testing

After completing the build script, you can run the test

npm test

Authors

  • Ezzat Chamudi - echamudi

See also the list of contributors who participated in this project.

License

Copyright © 2020 Ezzat Chamudi and OpenCV-WASM Project Authors

OpenCV-WASM code is licensed under BSD-3-Clause. Images, logos, docs, and articles in this project are released under CC-BY-SA-4.0.

Libraries, dependencies, and tools used in this project are tied with their licenses.

FAQs

Package last updated on 10 Nov 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc