本文整理汇总了Python中menpo.transform.Rotation.apply方法的典型用法代码示例。如果您正苦于以下问题:Python Rotation.apply方法的具体用法?Python Rotation.apply怎么用?Python Rotation.apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menpo.transform.Rotation
的用法示例。
在下文中一共展示了Rotation.apply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_align_2d_rotation_set_h_matrix_raises_notimplemented_error
# 需要导入模块: from menpo.transform import Rotation [as 别名]
# 或者: from menpo.transform.Rotation import apply [as 别名]
def test_align_2d_rotation_set_h_matrix_raises_notimplemented_error():
rotation_matrix = np.array([[0, 1], [-1, 0]])
rotation = Rotation(rotation_matrix)
source = PointCloud(np.array([[0, 1], [1, 1], [-1, -5], [3, -5]]))
target = rotation.apply(source)
# estimate the transform from source and source
estimate = AlignmentRotation(source, source)
# and set the target
estimate.set_h_matrix(rotation.h_matrix)
示例2: test_align_2d_rotation
# 需要导入模块: from menpo.transform import Rotation [as 别名]
# 或者: from menpo.transform.Rotation import apply [as 别名]
def test_align_2d_rotation():
rotation_matrix = np.array([[0, 1], [-1, 0]])
rotation = Rotation(rotation_matrix)
source = PointCloud(np.array([[0, 1], [1, 1], [-1, -5], [3, -5]]))
target = rotation.apply(source)
# estimate the transform from source and target
estimate = AlignmentRotation(source, target)
# check the estimates is correct
assert_allclose(rotation.h_matrix, estimate.h_matrix, atol=1e-14)
示例3: test_basic_3d_rotation
# 需要导入模块: from menpo.transform import Rotation [as 别名]
# 或者: from menpo.transform.Rotation import apply [as 别名]
def test_basic_3d_rotation():
a = np.sqrt(3.0)/2.0
b = 0.5
# this is a rotation of -30 degrees about the x axis
rotation_matrix = np.array([[1, 0, 0],
[0, a, b],
[0, -b, a]])
rotation = Rotation(rotation_matrix)
starting_vector = np.array([0, 1, 0])
transformed = rotation.apply(starting_vector)
assert_allclose(np.array([0, a, -b]), transformed)
示例4: test_basic_2d_rotation
# 需要导入模块: from menpo.transform import Rotation [as 别名]
# 或者: from menpo.transform.Rotation import apply [as 别名]
def test_basic_2d_rotation():
rotation_matrix = np.array([[0, 1],
[-1, 0]])
rotation = Rotation(rotation_matrix)
assert_allclose(np.array([0, -1]), rotation.apply(np.array([1, 0])))