How to use the opencv4nodejs-prebuilt.INTER_AREA 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 / scale-image.function.ts View on Github external
export async function scaleImage(image: cv.Mat, scaleFactor: number): Promise {
  const boundScaleFactor = lowerBound(scaleFactor, 0.0, 1.0);
  const scaledRows = Math.floor(image.rows * boundScaleFactor);
  const scaledCols = Math.floor(image.cols * boundScaleFactor);
  return image.resizeAsync(scaledRows, scaledCols, 0, 0, cv.INTER_AREA);
}