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


Python PointCloud.init_2d_grid方法代码示例

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


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

示例1: test_constrain_landmarks_to_bounds

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_constrain_landmarks_to_bounds():
    im = Image.init_blank((10, 10))
    im.landmarks['test'] = PointCloud.init_2d_grid((20, 20))
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        im.constrain_landmarks_to_bounds()
    assert not im.has_landmarks_outside_bounds()
    assert_allclose(im.landmarks['test'].lms.bounds(), im.bounds())
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:10,代码来源:image_basics_test.py

示例2: test_register_landmark_importer

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_register_landmark_importer(is_file):
    from menpo.shape import PointCloud
    lmark = PointCloud.init_2d_grid((1, 1))

    def foo_importer(filepath, **kwargs):
        return lmark

    is_file.return_value = True

    with patch.dict(mio.input.extensions.image_landmark_types, {}, clear=True):
        mio.register_landmark_importer('.foo', foo_importer)
        new_lmark = mio.import_landmark_file('fake.foo')
    assert lmark is new_lmark
开发者ID:grigorisg9gr,项目名称:menpo,代码行数:15,代码来源:io_import_test.py

示例3: test_pointcloud_init_2d_grid_incorrect_type_spacing_raises

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_pointcloud_init_2d_grid_incorrect_type_spacing_raises():
    PointCloud.init_2d_grid([10, 10], spacing={})
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:4,代码来源:pointcloud_test.py

示例4: test_pointcloud_init_2d_grid_3d_spacing_raises

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_pointcloud_init_2d_grid_3d_spacing_raises():
    PointCloud.init_2d_grid([10, 10], spacing=[1, 1, 1])
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:4,代码来源:pointcloud_test.py

示例5: test_pointcloud_init_2d_grid_3d_raises

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_pointcloud_init_2d_grid_3d_raises():
    PointCloud.init_2d_grid([10, 10, 10])
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:4,代码来源:pointcloud_test.py

示例6: test_pointcloud_init_2d_grid_unequal_spacing

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_pointcloud_init_2d_grid_unequal_spacing():
    pc = PointCloud.init_2d_grid([10, 10], spacing=(2., 3))
    assert pc.n_points == 100
    assert pc.n_dims == 2
    assert_allclose(pc.range(), [18, 27])
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:7,代码来源:pointcloud_test.py

示例7: test_pointcloud_init_2d_grid_single_spacing

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_pointcloud_init_2d_grid_single_spacing():
    pc = PointCloud.init_2d_grid([10, 10], spacing=2)
    assert pc.n_points == 100
    assert pc.n_dims == 2
    assert_allclose(pc.range(), [18, 18])
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:7,代码来源:pointcloud_test.py

示例8: test_pointcloud_init_2d_grid

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_pointcloud_init_2d_grid():
    pc = PointCloud.init_2d_grid([10, 10])
    assert pc.n_points == 100
    assert pc.n_dims == 2
    assert_allclose(pc.range(), [9, 9])
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:7,代码来源:pointcloud_test.py

示例9: test_init_from_pointcloud_return_transform

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_init_from_pointcloud_return_transform():
    correct_tr = Translation([5, 5])
    pc = correct_tr.apply(PointCloud.init_2d_grid((10, 10)))
    im, tr = Image.init_from_pointcloud(pc, return_transform=True)
    assert im.shape == (9, 9)
    assert_allclose(tr.as_vector(), -correct_tr.as_vector())
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:8,代码来源:image_basics_test.py

示例10: test_init_from_pointcloud

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_init_from_pointcloud():
    pc = PointCloud.init_2d_grid((10, 10))
    im = Image.init_from_pointcloud(pc)
    assert im.shape == (9, 9)
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:6,代码来源:image_basics_test.py

示例11: test_init_from_pointcloud_boundary

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_init_from_pointcloud_boundary():
    pc = PointCloud.init_2d_grid((10, 10))
    im = Image.init_from_pointcloud(pc, boundary=5)
    print(im.shape)
    assert im.shape == (19, 19)
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:7,代码来源:image_basics_test.py

示例12: test_init_from_pointcloud_attach_group

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_init_from_pointcloud_attach_group():
    pc = PointCloud.init_2d_grid((10, 10))
    im = Image.init_from_pointcloud(pc, group='test')
    assert im.shape == (9, 9)
    assert im.n_landmark_groups == 1
开发者ID:JeanKossaifi,项目名称:menpo,代码行数:7,代码来源:image_basics_test.py

示例13: test_pointcloud_init_2d_grid_3d_raises

# 需要导入模块: from menpo.shape import PointCloud [as 别名]
# 或者: from menpo.shape.PointCloud import init_2d_grid [as 别名]
def test_pointcloud_init_2d_grid_3d_raises():
    with raises(ValueError):
        PointCloud.init_2d_grid([10, 10, 10])
开发者ID:AshwinRajendraprasad,项目名称:menpo,代码行数:5,代码来源:test_pointcloud.py


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