2014-03-06 49 views
3

我正在使用OpenCV立體視覺,我的校準模塊正在運行。出於調試的目的,我想要顯示相機參數校準正在計算,我希望找到一些內置的功能來幫助實現這一點。我正在尋找類似於Matlab的showExtrinsics()的東西。任何建議/指向我自己的可視化?我無法在OpenCV文檔中找到任何有用的信息。如何在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.589346316e-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

我不認爲這是在OpenCV中這樣的事情。但原則上,您可以將校準數據轉換爲matlab,然後手動構建一個對象,然後您可以將其傳遞給showExtrinsics()

+0

好像我會訴諸管道數據到MATLAB然後 - 謝謝! – Daryl

+0

爲什麼不直接在Matlab中使用cameraCalibrator應用程序? – Dima

+0

我希望將可視化解決方案集成到我們的Python/C++代碼庫中,而不是使用Matlab的校準器。無論如何,我只需要少量的OpenCV函數調用來計算校準(主要是findChessBoardCorners,stereoRectify),所以不需要任何時間用Matlab進行校準。爲了調試的目的,但Matlab應該足夠了。 – Daryl