bbox_aggregate: Functions for aggregating bbox objects These functions can...

Description Usage Arguments Value Examples

Description

Functions for aggregating bbox objects These functions can perform union and intersection operations on bbox objects

Usage

1
2
3
4
5
bbox_union(bbox, fx1 = min, fy1 = min, fx2 = max, fy2 = max)

bbox_union2(bbox, bbox2)

bbox_intersect(bbox, bbox2 = NULL)

Arguments

bbox

character vector of bounding boxes to perform operation on

fx1, fy1, fx2, fy2

functions to use for aggregating x1, y1, x2, y2, respectively. Defaults to min for x1,y1 and max for x2,y2

bbox2

optional character vector of bounding boxes to element-wise aggregation with bbox. If specified, needs to be length 1 or equal in length to bbox.

Value

bbox or missing value, if result is invalid bounding box

Examples

1
2
3
4
bbox_union(c("5 1 7 3", "2 4 6 8"))
bbox_union2(c("5 1 7 3", "2 4 6 8"), c("1 1 1 1"))
bbox_intersect(c("5 1 7 3", "2 4 6 8")) # should return NA
bbox_intersect("5 1 7 3", "2 2 6 8")

dmi3kno/hocr documentation built on April 27, 2020, 10:39 a.m.