UNPKG

image-js

Version:

Image processing and manipulation in JavaScript

20 lines 601 B
/** * Scales the coordinates of the keypoints. * @param keypoints - Keypoints to scale. * @param scale - Scalar by which to multiply the coordinates. * @returns Scaled keypoints (copy of the original array). */ export function scaleKeypoints(keypoints, scale) { if (scale === 1) return keypoints.slice(); return keypoints.map((kpt) => { return { origin: { row: kpt.origin.row * scale, column: kpt.origin.column * scale, }, score: kpt.score, }; }); } //# sourceMappingURL=scaleKeypoints.js.map