首页 > 其他分享 >IPM逆透视变换问题1/3之:Vanish Point

IPM逆透视变换问题1/3之:Vanish Point

时间:2023-03-07 20:46:19浏览次数:36  
标签:mat Point 0.0 IPM vp expm cam np Vanish

IPM逆透视变换问题1/3之:Vanish Point
重要提醒:首先确定坐标系朝向,简化步骤须做出说明。

1. 坐标系

# world  coord [x-right,y-front,z-up]
# camera coord [x-right,y-down,z-front]
# image  coord [x-right,y-down,z-front(1)]
# pixel  coord [u-right,v-down]

2. 相机参数和姿态

# camera intrinsic parameter
cam_inpm = [640,640,640,512] #[f_x, f_y, c_x, c_y] [pixel,pixel,pixel,pixel] 
# camera extrinsic parameter
cam_expm = [0.0,0.0,3.0, 0.0,-8.0,6.0] # [x,y,z,roll,pitch,yaw] [m,m,m,deg,deg,deg]
mat_in = np.array([[cam_inpm[0],0,cam_inpm[2]],
                   [0,cam_inpm[1],cam_inpm[3]],
                   [0,0,1]])
                   
sr = np.sin(cam_expm[3]/180*np.pi)
cr = np.cos(cam_expm[3]/180*np.pi)
sp = np.sin(cam_expm[4]/180*np.pi)
cp = np.cos(cam_expm[4]/180*np.pi)
sy = np.sin(cam_expm[5]/180*np.pi)
cy = np.cos(cam_expm[5]/180*np.pi)

mat_wx = np.array([[1.0,0.0,0.0],[0.0,cr,-sr],[0.0,sr,cr]],dtype=float)
mat_wy = np.array([[cp,0.0,sp],[0.0,1.0,0.0],[-sp,0.0,cp]],dtype=float)
mat_wz = np.array([[cy,-sy,0.0],[sy,cy,0.0],[0.0,0.0,1.0]],dtype=float)
mat_ww = mat_wz @ mat_wy @ mat_wx   #extrinsic rotation z-y-x

mat_cc = np.array([[1.0,0.0,0.0],[0.0,0.0,1.0],[0.0,-1.0,0.0]],dtype=float)
mat_wc = mat_ww @ mat_cc

3. 设定消失点(sys_world)

# if only z_w=0 and x_w=0, so y_w=1/(cy*cr),             so vp_pp = [707.92777905 422.05386579]
# if only z_w=0,           so x_w=-sy/cr and y_w=cy/cr,  so vp_pp = [640.         422.05386579]
vp_ww = np.array([[0.0,1/(cy*cr),0.0]],dtype=float).T

4. 计算消失点(sys_pixel)

vp_cc = mat_wc.T @ vp_ww    
vp_ii = vp_cc / vp_cc[2,0]   #this line unnecessary, could be commented
vp_pp = mat_in @ vp_ii

标签:mat,Point,0.0,IPM,vp,expm,cam,np,Vanish
From: https://www.cnblogs.com/streamwill/p/17189565.html

相关文章

  • 无线和射频集成电路CC2651R3SIPAT0MOUR/CC2652PSIPMOTR/CC2651P31T0RKPR TxRx + MCU 2
    一、CC2651R3SIPAT0MOUR介绍:CC2651R3SIPA器件是一款多协议2.4GHz无线微控制器(MCU),支持Zigbee®、Bluetooth®5.2LowEnergy、IEEE802.15.4g、TI15.4stack(2.4GHz)......
  • AGC051E[Middle Point] 题解
    条件转化我们记:\[M=\{x|x=\frac{a}{2^b},a,b\in\mathbb{Z}\}\\M^*=\{x|x\inM,x\ge0\}\]令下文向量均为二维向量,记给定点集为\({\vec{p_n}}\)那么原题即为求满足\(......
  • 运行servlet项目时Failed to initialize end point associated with ProtocolHandler
    应该是端口被占用了,https://blog.csdn.net/qq_23853743/article/details/84432365这个是找到对应的pid然后杀死占用端口的进程。还有一招是书命令,没试过https://blog.c......
  • 【copy from】IEEE-754 Floating Point Converter
    图片截取自:IEEE-754FloatingPointConverter传送门:https://www.h-schmidt.net/FloatConverter/IEEE754.htmlExponent:用移码表示(格式与补码类似,只是MSB用1表示正数,用......
  • 转:web自动化-----------报错 Element * is not clickable at point,Other element woul
    出现报错Otherelementwouldreceivetheclick:的原因是;当你selenium中click()点击事件时,所选中的标签被外部div吸收了,因此解决办法就是进入里面进行点击操作。drive......
  • Static Probe Points in GDB
    参考:https://sourceware.org/gdb/onlinedocs/gdb/Static-Probe-Points.htmlhttps://man7.org/linux/man-pages/man3/stapprobes.3stap.html infoprobes--Showav......
  • What is Point ?
    学习心态指针其实跟一些运算符的表达式类似(例如i++,i--),它通过符号隐藏了内部的计算过程,只要学习者逐步的分解开,就很容易理解了。学习指针的时候,尽量想象底层硬件的工作方......
  • model checkpoint
    Amodelcheckpointisasavedcopyofthetrainedweightsandbiasesofaneuralnetworkmodelataspecificpointintimeduringthetrainingprocess.Itcan......
  • SharePoint Online 修改管理员角色不生效
    前言最近,公司新入职一个员工,据说是一个SharePoint大神级的人物,所以,来了先给他一个管理员角色。但是,发现了个奇怪的事情,明明给了角色,点击了确认,却一直不生效......
  • SharePoint Online 管理站点存储限制
    前言最近,我们申请的SharePointOnline站点的容量报警了,提示容量即将用完,所以,需要增加扩容。正文我们首先进入SharePointOnline的管理中心,我们通常可以......