我正在使用OpenCV立体视觉,我的校准模块出现了问题。为了调试的目的,我想可视化校准计算的相机参数,我希望找到一些内置的功能来帮助解决这个问题。我正在寻找一些类似于Matlab的 显示外貌(). 有什么建议可以指导我自己写可视化吗?我在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. ]
我认为OpenCV中没有这种东西。 但原则上,你可以把你的校准数据带入matlab,然后手动构建一个新的数据。cameraParameters
对象,然后你可以将其传递给 showExtrinsics()
.