使用已经找到的内在和外在参数在opencv上整形图像 [英] Rectifying images on opencv with intrinsic and extrinsic parameters already found
问题描述
我投放了Bouguet的校准工具箱( http://www.vision)。 caltech.edu/bouguetj/calib_doc/htmls/example.html ),并且具有来自校准的参数(内在的[焦距和主点偏移])和外在的[棋盘的旋转和平移相对于相机])。
I ran Bouguet's calibration toolbox (http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/example.html) on Matlab and have the parameters from the calibration (intrinsic [focal lengths and principal point offsets] and extrinsic [rotation and translations of the checkerboard with respect to the camera]).
我的图片上的棋盘的坐标点也是已知的。
Feature coordinate points of the checkerboard on my images are also known.
获得整形图像,以便我可以从每对校正的图像中创建视差图(对于其我有代码)。
I want to obtain rectified images so that I can make a disparity map (for which I have the code for) from each pair of rectified images.
我如何去做这个?
推荐答案
如果完全校准,请使用: http://link.springer.com/article/10.1007/s001380050120#page-1 两台相机的方向相同,共享相同的R。
If fully calibrated use: http://link.springer.com/article/10.1007/s001380050120#page-1 Both cameras have the same orientation, share the same R.
新R的第一行是两个摄像机中心的基线=减法。第二行与旧左z轴(3行R_old_left)的叉积。
First row of the new R is the baseline = subtraction of both camera centers. Second row cross product of baseline with old left z-axis (3 row R_old_left). Third row cross product of the first two rows.
使用H_left = P_new(1:3,1:3)* P_old_left(1:3,1:3) )^ -1和H_right = P_new(1:3,1:3)* P_old_right(1:3,1:3)^ -1。
Warp images with H_left=P_new(1:3,1:3)*P_old_left(1:3,1:3)^-1 and H_right=P_new(1:3,1:3)*P_old_right(1:3,1:3)^-1.
(h21 * u + h22 * v + h23)/(h31 * u + h32 * v),则h =(h11 * u + h12 * v + h13)/(h31 * u + h32 * v + h33) + h33),与正确的
Rectified left pixel coordinates are u_new=(h11*u+h12*v+h13)/(h31*u+h32*v+h33), v=(h21*u+h22*v+h23)/(h31*u+h32*v+h33), same with the right ones
这篇关于使用已经找到的内在和外在参数在opencv上整形图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!