image-js
Version:
Image processing and manipulation in JavaScript
13 lines • 551 B
JavaScript
import { getExtendedBorderPoints } from './utils/getExtendedBorderPoints.js';
import { getMbrFromPoints } from './utils/getMbrFromPoints.js';
import { monotoneChainConvexHull } from './utils/monotoneChainConvexHull.js';
/**
* Get the four corners of the minimum bounding rectangle of an ROI.
* @param mask - The ROI to process.
* @returns The array of corners.
*/
export function getMbr(mask) {
const vertices = monotoneChainConvexHull(getExtendedBorderPoints(mask));
return getMbrFromPoints(vertices);
}
//# sourceMappingURL=getMbr.js.map