WebARKitCV is an opinionated toolchain for producing lightweight OpenCV builds tailored to WebAR workloads. It bundles the scripts, configuration, and TypeScript helpers we use to compile our fork of OpenCV into a single-file ES module (opencv_js.js) that runs in modern browsers and Web Workers.
The project currently targets OpenCV 4.12.0 (forked under webarkit/opencv) and emsdk 3.1.69. Expect breaking changes while we continue to tune the build for smaller payloads and a smoother developer experience; treat the artifacts as experimental until we cut a stable release.
Getting started is as simple as cloning the repo, running one of the build scripts (build.sh on Unix, build_w_docker.bat on Windows), and loading the generated example pages under examples/ to validate your environment. Feedback and contributions are welcome—see the Issues section for discussion topics and the roadmap.
WebARKitCV is developed in the Typescript language; Type definitions are in the types folder.
We are using OpenCV version 4.12.0 (our modified fork) and emsdk 3.1.69
See the build scripts below; each one compiles the OpenCV ES module and copies it into the build folder. We are trying to build a lighter opencv_js.js, so we use a custom config to trim features we do not currently need. The module is based on our forked OpenCV tree, which adds ES module support—details live in issue #1.
build.sh: native Linux workflow that assumesemsdk/Emscripten is installed and on yourPATH.build_w_docker.sh: Linux/macOS workflow that wraps the build in the official Emscripten Docker image—no localemsdkinstall required.build_w_docker.bat: Windows PowerShell/Command Prompt variant that uses the same Docker-based flow.
- npm package
- documentation
- first WebAR example