如何在OpenCV中可视化内部/外部相机参数?

时间:2014-03-06 21:59:03

标签: c++ matlab opencv computer-vision matlab-cvst

我正在使用OpenCV立体视觉,我的校准模块正在运行。出于调试目的,我想可视化校准正在计算的摄像机参数,我希望找到一些内置功能来帮助解决这个问题。我正在寻找类似于Matlab showExtrinsics()的东西。编写我自己的可视化的任何建议/指针?我无法在OpenCV文档中找到任何有用的东西。

我的内在矩阵:

%YAML:1.0
M1: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 4.6716183686593592e+02, 0., 3.4685206899619874e+02, 0.,
       4.6716183686593592e+02, 2.6460277614179995e+02, 0., 0., 1. ]
D1: !!opencv-matrix
   rows: 1
   cols: 5
   dt: d
   data: [ 1.3545958543110964e-01, -2.0383389968255977e-01, 0., 0., 0. ]
M2: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 4.6716183686593592e+02, 0., 3.1321301298488936e+02, 0.,
       4.6716183686593592e+02, 2.7674405764548516e+02, 0., 0., 1. ]
D2: !!opencv-matrix
   rows: 1
   cols: 5
   dt: d
   data: [ 6.8017486649835202e-02, -1.2178761345435389e-01, 0., 0., 0. ]

我的外在矩阵:

%YAML:1.0
R: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 9.9771868227118155e-01, -7.5673210589346316e-03,
       6.7083281814831405e-02, 8.9579410266375625e-03,
       9.9975067896491787e-01, -2.0453244284196821e-02,
       -6.6911780275377294e-02, 2.1007512017769996e-02,
       9.9753771763237242e-01 ]
T: !!opencv-matrix
   rows: 3
   cols: 1
   dt: d
   data: [ -3.7118950200284830e+00, 2.0057520035877928e-02,
       -1.1958455121942886e-01 ]
R1: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 9.9498387348418538e-01, -1.2286209661821963e-02,
       9.9278097073585744e-02, 1.3314580062505074e-02,
       9.9986428207583911e-01, -9.7025453735457880e-03,
       -9.9145415749623558e-02, 1.0975722350366061e-02,
       9.9501242206050977e-01 ]
R2: !!opencv-matrix
   rows: 3
   cols: 3
   dt: d
   data: [ 9.9946687339085338e-01, -5.4006987617013216e-03,
       3.2199401348428379e-02, 5.0670326515128601e-03,
       9.9993271463178834e-01, 1.0435103699094591e-02,
       -3.2253591651478383e-02, -1.0266385049651746e-02,
       9.9942698941122865e-01 ]
P1: !!opencv-matrix
   rows: 3
   cols: 4
   dt: d
   data: [ 4.2226276527153402e+02, 0., 2.8740816497802734e+02, 0., 0.,
       4.2226276527153402e+02, 2.7487768363952637e+02, 0., 0., 0., 1.,
       0. ]
P2: !!opencv-matrix
   rows: 3
   cols: 4
   dt: d
   data: [ 4.2226276527153402e+02, 0., 2.8740816497802734e+02,
       -1.5682311212949173e+03, 0., 4.2226276527153402e+02,
       2.7487768363952637e+02, 0., 0., 0., 1., 0. ]
Q: !!opencv-matrix
   rows: 4
   cols: 4
   dt: d
   data: [ 1., 0., 0., -2.8740816497802734e+02, 0., 1., 0.,
       -2.7487768363952637e+02, 0., 0., 0., 4.2226276527153402e+02, 0.,
       0., -2.6926054427670321e-01, 0. ]

1 个答案:

答案 0 :(得分:1)

我认为OpenCV中没有这样的东西。但是,原则上,您可以将校准数据转换为matlab,然后手动构建cameraParameters对象,然后将其传递到showExtrinsics()