1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

fix the perf tests of OpenCV.js so that it can run on Node.js successfully

This commit is contained in:
lionkun
2021-03-24 16:34:22 +08:00
committed by Alexander Alekhin
parent bf03f5fa3a
commit 8d232a63ad
17 changed files with 84 additions and 17 deletions
+9
View File
@@ -1,5 +1,10 @@
if (typeof window === 'undefined') {
var cv = require("../opencv");
if (cv instanceof Promise) {
loadOpenCV();
} else {
cv.onRuntimeInitialized = perf;
}
}
let gCvSize;
@@ -24,6 +29,10 @@ function getCvSize() {
return gCvSize;
}
async function loadOpenCV() {
cv = await cv;
}
if (typeof window === 'undefined') {
exports.getCvSize = getCvSize;
}