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


Python CameraModel.load_camera_simple方法代码示例

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


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

示例1: make_default_system

# 需要导入模块: from pymvg.camera_model import CameraModel [as 别名]
# 或者: from pymvg.camera_model.CameraModel import load_camera_simple [as 别名]
def make_default_system(with_separate_distorions=False):
    """helper function to generate an instance of MultiCameraSystem"""
    if with_separate_distorions:
        raise NotImplementedError
    camxs = np.linspace(-2, 2, 3)
    camzs = np.linspace(-2, 2, 3).tolist()
    camzs.pop(1)
    cameras = []
    lookat = np.array((0.0, 0, 0))
    up = np.array((0.0, 0, 1))

    for enum, camx in enumerate(camxs):
        center = np.array((camx, -5, 0))
        name = "camx_%d" % (enum + 1,)
        cam = CameraModel.load_camera_simple(name=name, fov_x_degrees=45, eye=center, lookat=lookat, up=up)
        cameras.append(cam)

    for enum, camz in enumerate(camzs):
        center = np.array((0, -5, camz))
        name = "camz_%d" % (enum + 1,)
        cam = CameraModel.load_camera_simple(name=name, fov_x_degrees=45, eye=center, lookat=lookat, up=up)
        cameras.append(cam)

    system = MultiCameraSystem(cameras)
    return system
开发者ID:nickgravish,项目名称:pymvg,代码行数:27,代码来源:test_mcsc.py

示例2: make_default_system

# 需要导入模块: from pymvg.camera_model import CameraModel [as 别名]
# 或者: from pymvg.camera_model.CameraModel import load_camera_simple [as 别名]
def make_default_system():
    '''helper function to generate an instance of MultiCameraSystem'''
    lookat = np.array( (0.0, 0.0, 0.0))

    center1 = np.array( (0.0, 0.0, 0.9) )
    distortion1 = np.array( [0.2, 0.3, 0.1, 0.1, 0.1] )
    cam1 = CameraModel.load_camera_simple(name='cam1',
                                          fov_x_degrees=90,
                                          eye=center1,
                                          lookat=lookat,
                                          distortion_coefficients=distortion1,
                                          )

    center2 = np.array( (0.5, -0.8, 0.0) )
    cam2 = CameraModel.load_camera_simple(name='cam2',
                                          fov_x_degrees=90,
                                          eye=center2,
                                          lookat=lookat,
                                          )

    center3 = np.array( (0.5, 0.5, 0.0) )
    cam3 = CameraModel.load_camera_simple(name='cam3',
                                          fov_x_degrees=90,
                                          eye=center3,
                                          lookat=lookat,
                                          )

    system = MultiCameraSystem([cam1,cam2,cam3])
    return system
开发者ID:nickgravish,项目名称:pymvg,代码行数:31,代码来源:emit_sample_pymvg_file.py

示例3: test_equals

# 需要导入模块: from pymvg.camera_model import CameraModel [as 别名]
# 或者: from pymvg.camera_model.CameraModel import load_camera_simple [as 别名]
def test_equals():
    system = make_default_system()
    assert system != 1234

    system2 = MultiCameraSystem([CameraModel.load_camera_simple(name='cam%d'%i) for i in range(2)])
    system3 = MultiCameraSystem([CameraModel.load_camera_simple(name='cam%d'%i) for i in range(3)])
    assert system2 != system3

    system4 = make_default_system()
    d = system4.to_dict()
    d['camera_system'][0]['width'] += 1
    system5 = MultiCameraSystem.from_dict( d )
    assert system4 != system5
开发者ID:strawlab,项目名称:pymvg,代码行数:15,代码来源:test_multi_camera_system.py

示例4: test_align

# 需要导入模块: from pymvg.camera_model import CameraModel [as 别名]
# 或者: from pymvg.camera_model.CameraModel import load_camera_simple [as 别名]
def test_align():
    system1 = make_default_system()
    system2 = system1.get_aligned_copy( system1 ) # This should be a no-op.
    assert system1==system2

    system3 = MultiCameraSystem([CameraModel.load_camera_simple(name='cam%d'%i) for i in range(2)])
    nose.tools.assert_raises(ValueError, system3.get_aligned_copy, system1)
开发者ID:strawlab,项目名称:pymvg,代码行数:9,代码来源:test_multi_camera_system.py

示例5: test_equality

# 需要导入模块: from pymvg.camera_model import CameraModel [as 别名]
# 或者: from pymvg.camera_model.CameraModel import load_camera_simple [as 别名]
def test_equality():
    center = np.array( (0, 0.0, 5) )
    lookat = center + np.array( (0,1,0))
    cam_apple1 = CameraModel.load_camera_simple(fov_x_degrees=90,
                                                eye=center,
                                                lookat=lookat,
                                                name='apple')
    cam_apple2 = CameraModel.load_camera_simple(fov_x_degrees=90,
                                                eye=center,
                                                lookat=lookat,
                                                name='apple')
    cam_orange = CameraModel.load_camera_simple(fov_x_degrees=30,
                                                eye=center,
                                                lookat=lookat,
                                                name='orange')
    assert cam_apple1==cam_apple2
    assert cam_apple1!=cam_orange
    assert not cam_apple1==cam_orange
开发者ID:thinkerahead,项目名称:pymvg,代码行数:20,代码来源:test_camera_model.py

示例6: test_no_duplicate_names

# 需要导入模块: from pymvg.camera_model import CameraModel [as 别名]
# 或者: from pymvg.camera_model.CameraModel import load_camera_simple [as 别名]
def test_no_duplicate_names():
    cam1a = CameraModel.load_camera_simple(name='cam1')
    cam1b = CameraModel.load_camera_simple(name='cam1')
    cams = [cam1a,cam1b]
    nose.tools.assert_raises(ValueError, MultiCameraSystem, cams)
开发者ID:strawlab,项目名称:pymvg,代码行数:7,代码来源:test_multi_camera_system.py

示例7: test_simple_camera

# 需要导入模块: from pymvg.camera_model import CameraModel [as 别名]
# 或者: from pymvg.camera_model.CameraModel import load_camera_simple [as 别名]
def test_simple_camera():
    center = np.array( (0, 0.0, 5) )
    lookat = center + np.array( (0,1,0))
    cam = CameraModel.load_camera_simple(fov_x_degrees=90,
                                         eye=center,
                                         lookat=lookat)
开发者ID:thinkerahead,项目名称:pymvg,代码行数:8,代码来源:test_camera_model.py


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