【问题标题】:Convert a rigid transformation so that the rotation center is not the origin转换一个刚性变换,使旋转中心不是原点
【发布时间】: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


    【解决方案1】:

    在编写问题时,我遇到了(显而易见的)解决方案,它只是扩展了我之前编写的解决方案并重新排列。如果有人也需要这个,新的转换应该是:

    y = R_new*v + t_new

    其中R_new = Rt_new = (I - R)*cenI 是身份。

    【讨论】:

    • 如果使用齐次坐标,则变换矩阵为T*R*(invT)。
    猜你喜欢
    • 1970-01-01
    • 2018-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-24
    • 1970-01-01
    • 2021-07-17
    • 1970-01-01
    相关资源
    最近更新 更多