Skip to content

Computer vision, in your language.

opencv-wasmOpenCV 5.0.0 · TypeScript · CPU WASM

From pixels to an understanding of the scene. Bring OpenCV to the browser and Node.js, with typed APIs and a visual guide to the ideas behind them.

VISUAL WALKTHROUGHGeometry
REFERENCE INPUTTentative correspondences

Eight tentative matches include two inconsistent pairs, shown in orange.

RESULTRecover the projective plane

The accepted mapping bends a rectangular grid into perspective. Every grid intersection uses the same projective transform as the inlier points.

STEP 03 / 03

Refine the mapping using the accepted correspondences.

Illustrative example. The stages explain the method; they are not a live OpenCV execution.

5.0.0 native OpenCV56 configured CPU modulesESM browser, worker, Node

@banou/opencv-wasm compiles OpenCV and its contrib modules directly from C++ to WebAssembly. The API includes image processing, features, calibration, tracking, machine learning, DNN inference and more. Your editor gets parameter descriptions, exact overloads and distinct native handle types.

import { CV_8UC1, initOpenCV, Mat, matFromArray, THRESH_BINARY, threshold } from '@banou/opencv-wasm'
await initOpenCV()
using image = matFromArray(2, 3, CV_8UC1, [0, 30, 90, 150, 220, 255])
using binary = new Mat()
threshold(image, binary, 127, 255, THRESH_BINARY)
console.log(binary.data.slice()) // [0, 0, 0, 255, 255, 255]

This example runs in Node with the installed build. Browser bundlers should pass the WASM asset URL explicitly; the quickstart shows the complete setup.

This is a CPU build with WebAssembly SIMD. Browser and Node use the same native engine. Models, fonts and OCR data are supplied by your application. Python name coverage is measured separately from behavior and signature compatibility; the compatibility page records both the capabilities and the limits.