2016-04-24 369 views
2

我不是想整頓對立體圖像,但我從功能上得到一個奇怪的錯誤rectifyStereoImages拋出「沒有足夠的輸入參數錯誤」

Error using rectifyStereoImages (line 106) 
Not enough input arguments. 

Error in RealTimeProcessing>captureButton_Callback (line 134) 
[I1Rect, I2Rect] = rectifyStereoImages(I1, I2,stereoParams); 

自己編寫的代碼行是

[I1Rect, I2Rect] = rectifyStereoImages(I1, I2,stereoParams); 

正如您所看到的,兩個圖像和stereoParameters都存在。我通過使用MATLAB中的立體相機校準工具獲得了stereoParams。是否有一些我缺少的輸入?鏈接到文件是here。我已經包含了兩個輸入圖像和stereoParams。

+0

它給了我rectifyStereoImages.m文件的路徑 /Applications/MATLAB_R2015b.app/toolbox/vision/vision/rectifyStereoImages.m –

+0

它的工作原理,當我使用[這](http://in.mathworks.com /help/vision/examples/uncalibrated-stereo-image-rectification.html)教程。但是我已經校準了我的相機,所以我正在使用[this](http://in.mathworks.com/help/vision/ref/rectifystereoimages.html),並且出現此錯誤。 –

回答

2

class(stereoParams)返回什麼?

rectifyStereoImages函數有兩種語法:校準和未校準。對於校準的情況下,它需要兩個圖像和一個stereoParameters對象。對於未校準的情況,它需要類projective2d的兩個圖像和兩個投影變換對象。

從你寫的東西看來,你的stereoParams實際上是一個投影轉換對象。在這種情況下,rectifyStereoImages進入未校準模式,並期待其中兩個。

+0

我運行了'class(s​​tereoParams)',並且實現了'stereoParams'對象被存儲爲一個1x1對象,其中包含原始'stereoParams'對象。所以我只是用'[I1Rect,I2Rect] =整流立體聲圖像(I1,I2,stereoParams.stereoParams)'替換了'I1Rect,I2Rect] =整流立體聲圖像(I1,I2,stereoParams);''現在完美。謝謝。 –

相關問題