theothergrantdavidson / opencv-ts

A place for the typescript bindings for OpencvJS
Apache License 2.0
51 stars 18 forks source link

opencv-ts

Package for opencvjs in typescript (WIP), adding class and function definiitons progresssively.

compatibility

Compatible with OpenCV 4.5 version

example use

import cv, { Mat, Rect } from "opencv-ts";

cv.onRuntimeInitialized = () => {
    const src = cv.imread("inputCanvas");
    const dst: Mat = new cv.Mat(src.cols, src.rows, cv.CV_8UC4);

    cv.resize(src, dst, new cv.Size(500, 500), 0, 0, cv.INTER_AREA);

    const roiRect: Rect = new cv.Rect(0, 0, 200, 200);

    const roi = dst.roi(roiRect);

    cv.imshow('outputCanvas', roi);
};

Typings Progress