How to use the opencv4nodejs-prebuilt.CV_8UC4 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-processor.class.ts View on Github external
public static async fromImageWithAlphaChannel(
    img: Image,
    roi?: Region,
  ): Promise {
    const mat = await new cv.Mat(img.data, img.height, img.width, cv.CV_8UC4).cvtColorAsync(cv.COLOR_BGRA2BGR);
    if (roi) {
      return mat.getRegion(determineROI(img, roi));
    } else {
      return mat;
    }
  }