matlab建立二维坐标系,matlab – 从二维像素重建相机坐标系中的三维坐标 – 边条件...

我正在尝试使用边条件(在MatLab中)从相机图片中的2D像素坐标重建3D坐标.我确实有外在和内在的相机参数.

使用同质变换,我可以将3D坐标从初始世界坐标系转换为我的相机坐标系.所以我在变换矩阵R_world_to_Camera中有我的外部参数:

R_world_to_Camera = [ r_11, r_12, r_13, t1;

r_21, r_22, r_23, t2;

r_31, r_32, r_33, t3;

0, 0, 0, 1];

对于内在参数,我使用了Caltech的“MatLab相机校准工具箱”并获得了以下参数:

Calibration results (with uncertainties):

Focal Length: fc = [ 1017.21523 1012.54901 ] ± [ NaN NaN ]

Principal point: cc = [ 319.50000 239.50000 ] ± [ NaN NaN ]

Skew: alpha_c = [ 0.00000 ] ± [ NaN ] => angle of pixel axes = 90.00000 ± NaN degrees

Distortion: kc = [ 0.00000 0.00000 0.00000 0.00000 0.00000 ] ± [ NaN NaN NaN NaN NaN ]

Pixel error: err = [ 0.11596 0.14469 ]

Note: The numerical errors are approximately three times the standard deviations (for reference).

所以我得到了Camera-Calibration-Matrix K(3×3)

K = [1.017215234570303e+03, 0, 3.195000000000000e+02;

0, 1.012549014668498e+03,2.395000000000000e+02;

0, 0, 1.0000];

并使用这个我可以计算3D – > 2D – 投影 – 矩阵P(3×4):

P = K * [eye(3), zeros(3,1)];

在世界坐标[X,Y,Z] _World中转换点时,我首先将其转换为相机坐标,然后将其投影到2D:

% Transformation

P_world = [X; Y; Z; 1]; % homogenous coordinates in World coordinate System

P_camera = R_world_to_Camera * [X; Y; Z; 1];

% Projection

P_pixels = P * camera;

P_pixels = P_pixels / P_pixels(3); % normalize coordinates

所以我现在的问题是如何扭转这些步骤?作为边条件,我想设置Z坐标(世界坐标为零).我尝试了here on Stackoverflow提出的解决方案,但不知怎的,我得到了错误的坐标.任何的想法?每一个帮助都很受欢迎!!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值