当前位置: 首页>>代码示例>>Python>>正文


Python PointCloud.as_vector方法代码示例

本文整理汇总了Python中menpo.shape.PointCloud.as_vector方法的典型用法代码示例。如果您正苦于以下问题:Python PointCloud.as_vector方法的具体用法?Python PointCloud.as_vector怎么用?Python PointCloud.as_vector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在menpo.shape.PointCloud的用法示例。


在下文中一共展示了PointCloud.as_vector方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_pointcloud_flatten_rebuild

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import as_vector [as 别名]
def test_pointcloud_flatten_rebuild():
    points = np.array([[1, 2, 3], [1, 1, 1]])
    pc = PointCloud(points)
    flattened = pc.as_vector()
    new_pc = pc.from_vector(flattened)
    assert np.all(new_pc.n_dims == pc.n_dims)
    assert np.all(new_pc.n_points == pc.n_points)
    assert np.all(pc.points == new_pc.points)
开发者ID:nontas,项目名称:menpo,代码行数:10,代码来源:pointcloud_test.py

示例2: sparse_target

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import as_vector [as 别名]
    def sparse_target(self):
        r"""
        The current sparse `menpo.shape.PointCloud` that this object produces.

        :type: `menpo.shape.PointCloud`
        """
        sparse_target = PointCloud(self.target.points[:self.n_landmarks])
        return self._sparse_instance.from_vector(sparse_target.as_vector())
开发者ID:KeeganRen,项目名称:menpofit,代码行数:10,代码来源:modeldriven.py

示例3: mean_pointcloud

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import as_vector [as 别名]
def mean_pointcloud(pointclouds):
    r"""
    Compute the mean of a `list` of :map:`PointCloud` or subclass objects.
    The list is assumed to be homogeneous i.e all elements of the list are
    assumed to belong to the same point cloud subclass just as all elements
    are also assumed to have the same number of points and represent
    semantically equivalent point clouds.

    Parameters
    ----------
    pointclouds: `list` of :map:`PointCloud` or subclass
        List of point cloud or subclass objects from which we want to compute
        the mean.

    Returns
    -------
    mean_pointcloud : :map:`PointCloud` or subclass
        The mean point cloud or subclass.
    """
    # make a temporary PointCloud (with copy=False for low overhead)
    tmp_pc = PointCloud(sum(pc.points for pc in pointclouds) /
                        len(pointclouds), copy=False)
    # use the type of the first element in the list to rebuild from the vector
    return pointclouds[0].from_vector(tmp_pc.as_vector())
开发者ID:AshwinRajendraprasad,项目名称:menpo,代码行数:26,代码来源:groupops.py

示例4: sparse_target

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import as_vector [as 别名]
 def sparse_target(self):
     sparse_target = PointCloud(self.target.points[:self.n_landmarks])
     return self._sparse_instance.from_vector(sparse_target.as_vector())
开发者ID:HaoyangWang,项目名称:menpofit,代码行数:5,代码来源:modeldriven.py


注:本文中的menpo.shape.PointCloud.as_vector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。