相机生成图像坐标(已知相机的内外参数矩阵,和空间目标点的位姿,反推生成图像坐标)

% initia the terminal
clear; 
clc;

% the initial position
P = [10;10;10];

%% [u,v,1] = 1/s * K * (T * P)_1:3
% T = [R t;0 1]
% solve the u,v, set the T and K
%-------set the T-----
R = eul2rotm([0,-pi/2,0]);
t = [0;10;100];

%(T * P)_1:3 = R*P+t
%----set the K-----
fx = 1500;
fy = 1500;
cx = 500; 
cy = 400;
K = [fx,0,cx;0,fy,cy;0,0,1];

sU = K * (R*P+t);
% the coordinate of image
U = sU/sU(3);

fprintf("the x of image is: %.4f\n",U(1));
fprintf("the y of image is: %.4f \n",U(2));

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值