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:
committed by
Alexander Alekhin
parent
bf03f5fa3a
commit
8d232a63ad
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user