Repository navigation
The toolchain moves to Emscripten 6.0.12 and the supported Node.js versions to 22 and later. 4.0.0 also includes the fixes prepared for 3.1.0, which was never published. OpenCV stays at 5.0.0. Full notes: CHANGELOG.md.
npm install @haoking/opencvjs@4.0.0Breaking changes
- Node.js 22 or later; browsers need Chrome 85+, Firefox 79+ or Safari 15+.
- A failed assertion inside OpenCV throws
RuntimeError: Aborted(undefined)instead of a bare number. - 23 Emscripten runtime internals are gone from
cv(onRuntimeInitialized, thedynCall_*stubs, the browser main-loop helpers, …). - Error messages are in English.
New
- MCC color checker detection:
cv.mcc_CCheckerDetector,cv.mcc_CChecker,cv.mcc_DetectorParametersMCC. usingon Mats (Symbol.dispose) and iterable Embind vectors, both declared inindex.d.ts.- The wasm heap grows up to 2 GB instead of 1 GB.
Fixes
Saturating in-place writes on integer Mats, exact norm2 on integers (plus NORM_RELATIVE and NORM_HAMMING), correct results on native roi() views, SIMD rounding identical to cvRound, no leaks in cv.matFromArray and reshapeRows, and more — see the CHANGELOG.
Single-file build
opencv-4.0.0-standalone.js below is the single-file baseline build for a direct <script> include: no SIMD, native OpenCV only (the extension layer is in the npm package). The wasm is embedded as UTF-8, so serve the file as text/javascript; charset=utf-8, or load it from a page with <meta charset="utf-8">.