TechStark / opencv-js

OpenCV JavaScript version for node.js or browser

Home Page:https://npmjs.com/@techstark/opencv-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Want to know if this opencv-js can be used in Angular10

WisarutBholsithi opened this issue · comments

Dear Sir,

I would like know whether this opencv-js can be used in Angular10 or only for React platform.
If it can be use in Angular Platform, I would like to know how to implement the system to enable to use OpenCV.js

@WisarutBholsithi this opencv-js does not bind anything to React. You can use it in Angular for sure.
use import cv from "@techstark/opencv-js" then you can call method on cv.

@WisarutBholsithi this opencv-js does not bind anything to React. You can use it in Angular for sure. use import cv from "@techstark/opencv-js" then you can call method on cv.

I have used import cv from "@techstark/opencv-js" on my code in TS file of Angular and got the following error :

ERROR in src/app/core/models/human-face.ts:5:8 - error TS1192: Module '"D:/Z-Face/ZFaceDragDropCanvas/ZFaceSketch/z-face/z-face-client/node_modules/@techstark/opencv-js/dist/types/index"' has no default export.

The command import cv from "@techstark/opencv-js" will work in JavaScript file but not in case of TypeScript (TS) file though.

When I change to import {cv} from "@techstark/opencv-js" to be in line with the library import convention of TypeScript (TS) file and Angular10, I got the following error instead:

error TS2724: Module '"../../../../node_modules/@techstark/opencv-js/dist/types"' has no exported member 'cv'. Did you mean 'CV'?
import { cv } from "@techstark/opencv-js"

The way to make it works is to set the import as follows:
import { CV as cv } from "@techstark/opencv-js"

More will follow soon.