Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}