How to use the opencv4nodejs-prebuilt.imreadAsync function in opencv4nodejs-prebuilt

To help you get started, we’ve selected a few opencv4nodejs-prebuilt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nut-tree / nut.js / lib / provider / opencv / image-reader.class.ts View on Github external
return new Promise<img>(async (resolve, reject) =&gt; {
      try {
        const image = await cv.imreadAsync(path, cv.IMREAD_UNCHANGED);
        resolve(new Image(image.cols, image.rows, image.getData(), image.channels));
      } catch (e) {
        reject(`Failed to load image from '${path}'`);
      }
    });
  }