getMinBBox(shotGroups)
getMinBBox()所属R语言包:shotGroups
Minimum-area bounding box for a set of 2D-points
最小面积的包围盒为一组二维点
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Calculates the vertices of the minimum-area, possibly oriented bounding box given a set of 2D-coordinates.
计算的最小面积,可能给定一组二维坐标的方向包围盒的顶点。
用法----------Usage----------
getMinBBox(xy)
参数----------Arguments----------
参数:xy
a numerical (n x 2)-matrix with the (x,y)-coordinates of n >= 2 points (1 row of coordinates per point).
数值(为nx 2)矩阵的(x,y)的坐标的n> = 2分(1行的每点的坐标)。
值----------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.
(4×2)矩阵的(有序的)顶点的坐标。
参数:width
width of the box.
框的宽度。
参数:height
height of the box.
框的高度。
参数:angle
orientation of the box' longer edge pointing up as returned by atan2, but in degree.
这个盒子的长边朝上返回atan2的方向,但在程度上。
参见----------See Also----------
drawBox2, getBoundingBox, getMinCircle
drawBox2,getBoundingBox,getMinCircle
实例----------Examples----------
xy <- matrix(round(rnorm(16, 100, 15)), ncol=2)
bb <- getMinBBox(xy) # minimum bounding box[最小包围盒]
H <- chull(xy) # convex hull[凸包]
# plot original points, convex hull, and minimum bounding box[积原始点,凸包,最小包围盒]
plot(xy, xlim=range(c(xy[ , 1], bb$pts[ , 1])),
ylim=range(c(xy[ , 2], bb$pts[ , 2])), asp=1, pch=16)
polygon(xy[H, ], col=NA) # show convex hull[显示凸包]
drawBox2(bb$pts, fg='blue', colCtr='blue', pch=4, cex=2)
bb$width * bb$height # box area[框区域]
bb$angle # box orientation[箱方向]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|