从以相机为中心的坐标到以图案为中心的坐标

Going from camera-centric coordinates to pattern-centric coordinates

我目前在相机中设置了一个相机对齐模型作为原点坐标:

http://i.imgur.com/UnSCAvG.png

而且,由于相机是固定的,我正在尝试将系统转换为模式固定模型

http://i.imgur.com/OKunxwA.png

Matlab 非常好,可以向我展示它,但遗憾的是,除非它是在固定相机模型上,否则我找不到提取数据的方法。应用平移和旋转的逆向在系统之间进行更改应该是一件简单的事情,但不幸的是,这不起作用,我不明白为什么。

oldpoint = [0 0 0 1]';

translation = ([1 0  0 18.1043121043; 0 1 0 31.092351038; 0 0 1 -80.0610295707; 0 0 0 1]);
rotation = [eul2rotm([0.0957937074  -0.0234017529   -0.037084526]) zeros(3,1); 0 0 0 1];


newpoint = translation * point;

newpoint = rotation * newpoint;

我已经尝试了几种不同的替代方法,但到目前为止 none 接近我试图获得的坐标。

有两件事出错了,matlab 没有使用欧拉角,Z 需要反转。

clc;
clear;
%%
oldpoint = [0 0 0 1]';

newpoints = zeros(13,4);

i = 1;
while( i<= length(translations) )
    trans = translations(i,:);
    rota = rotations(i,:);

    display(trans);
    display(rota);

    translation = ([1 0  0 -trans(1); 0 1 0 -trans(2); 0 0 1 trans(3); 0 0 0 1]);
    rotation = [rotationVectorToMatrix([-rota(1) -rota(2) -rota(3)]) zeros(3,1); 0 0 0 1];

    newpoint = translation  * oldpoint;
    newpoint = rotation * newpoint;

    newpoints(i,:) = newpoint;
    i = i + 1;
end