本文整理汇总了Python中menpo.shape.PointCloud.bounding_box方法的典型用法代码示例。如果您正苦于以下问题:Python PointCloud.bounding_box方法的具体用法?Python PointCloud.bounding_box怎么用?Python PointCloud.bounding_box使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menpo.shape.PointCloud
的用法示例。
在下文中一共展示了PointCloud.bounding_box方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pointcloud_bounding_box_3d
# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import bounding_box [as 别名]
def test_pointcloud_bounding_box_3d():
points = np.array([[1.0, 2.0, 3.0], [3.0, 2.0, 1.0]])
pc = PointCloud(points)
bb = pc.bounding_box()
bb_bounds = bb.bounds()
assert_allclose(bb_bounds[0], [1.0, 2.0, 1.0])
assert_allclose(bb_bounds[1], [3.0, 2.0, 3.0])
示例2: test_pointcloud_bounding_box
# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import bounding_box [as 别名]
def test_pointcloud_bounding_box():
points = np.array([[0, 0],
[1., 1],
[0, 2]])
pc = PointCloud(points)
bb = pc.bounding_box()
bb_bounds = bb.bounds()
assert_allclose(bb_bounds[0], [0., 0.])
assert_allclose(bb_bounds[1], [1., 2.])
示例3: _align_mean_shape_with_bbox
# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import bounding_box [as 别名]
def _align_mean_shape_with_bbox(self, bbox):
# Convert 3D landmarks to 2D by removing the Z axis
template_shape = PointCloud(self.mm.landmarks.points[:, [1, 0]])
# Rotation that flips over x axis
rot_matrix = np.eye(template_shape.n_dims)
rot_matrix[0, 0] = -1
template_shape = Rotation(rot_matrix,
skip_checks=True).apply(template_shape)
# Align the 2D landmarks' bbox with the provided bbox
return AlignmentSimilarity(template_shape.bounding_box(),
bbox).apply(template_shape)
示例4: test_pointcloud_bounding_box_3d_fail
# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import bounding_box [as 别名]
def test_pointcloud_bounding_box_3d_fail():
points = np.array([[0, 0, 0],
[1, 1, 1]])
pc = PointCloud(points)
pc.bounding_box()