-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Now, I just try to use OpenCV in javascript for my project that use Angular Platform and I have already declare cv in he following fashion.
import {CV as cv} from "@techstark/opencv-js"
However, when I just declare that
/// human_face.ts
setHead(head: FaceComposition, params?: {}): FaceComposition {
const imageObject = head.imageObj;
const canvas = head.canvas;
const context = head.context;
......const imgData = context.getImageData(0, 0, canvas.width, canvas.height);
let src = cv.matFromImageData(imgData); // => ERROR ReferenceError: cv is not defined
// the way to get image data from canvas context for OpenCV processing!
....
}
I got a problem when i try use function cv.matFromImageData. as "ERROR ReferenceError: cv is not defined", it seems to me that opencv.js has failed to load properly according to the error message.
Therefore, I would like to know how to ensure that opencv.js would be properly loaded into the web.
Hope to get answer son,