How to use the opencv4nodejs-prebuilt.imwriteAsync 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 / template-matching-finder.class.ts View on Github external
function debugImage(image: cv.Mat, filename: string, suffix?: string) {
  const parsedPath = path.parse(filename);
  let fullFilename = parsedPath.name;
  if (suffix) {
    fullFilename = fullFilename + "_" + suffix;
  }
  fullFilename += parsedPath.ext;
  const fullPath = path.join(parsedPath.dir, fullFilename);
  cv.imwriteAsync(fullPath, image);
}
github nut-tree / nut.js / lib / provider / opencv / image-writer.class.ts View on Github external
public async store(data: Image, path: string): Promise {
    let outputMat: cv.Mat;
    if (data.hasAlphaChannel) {
      outputMat = await ImageProcessor.fromImageWithAlphaChannel(data);
    } else {
      outputMat = await ImageProcessor.fromImageWithoutAlphaChannel(data);
    }
    return cv.imwriteAsync(path, outputMat);
  }
}