【发布时间】:2020-09-19 00:46:22
【问题描述】:
给定一个旋转矩阵R,什么是等价变换使得在y = R * c变换下某个点c(新的旋转中心)不变,即改变R使得旋转中心为在c 而不是原点。一个限制是我不能对要使用的实际向量进行操作,只能编辑原始转换(这是因为该部分隐藏在外部库中,我无法更改它)。
我有一些可行的方法,但它违反了上述限制:
import numpy as np
# R is a given rotation matrix, v is an arbitrary vector and cen is the desired center
theta = np.pi / 2
cen = np.array([0.5, 0.5])
v = np.array([0, 0])
R = Rot(theta) # ordinary rotation matrix
y = R @ (v - center ) + cen
# y = [0, 1] which is the expected result since we have a right angle triangle
# with vertices at (0, 0) (0.5, 0.5) and (0, 1)
我也尝试实现类似于here 的计算,但我得到的结果不正确
我怎样才能获得相同的结果但保持y = R*v 的形式(或使用刚性变换y = R*v + t)但不像我一样更改v?
【问题讨论】:
标签: python algorithm image-processing computer-vision