getMinBBox: Minimum-Area Bounding Box For A Set Of 2D-Points

Description Usage Arguments Value

View source: R/image_processing_utils.R

Description

Calculates the vertices of the minimum-area, possibly oriented bounding box given a set of 2D-coordinates. Adapted from shotGroups package.

Usage

1

Arguments

xy

either a numerical (n x 2)-matrix with the (x,y)-coordinates of n >= 2 points (1 row of coordinates per point), or a data frame with either the variables x, y or point.x, point.y.

Value

A list with the following information about the minimum-area bounding box:

pts

a (4 x 2)-matrix containing the coordinates of the (ordered) vertices.

width

width of the box.

height

height of the box.

FoM

figure of merit, i.e., the average side length of the box: (width + height) / 2.

diag

length of box diagonal.

angle

orientation of the box' longer edge pointing up as returned by atan2, but in degree.


MartinHinz/shapAAR documentation built on July 12, 2020, 7:41 p.m.