我有一個程序,檢測實時視頻流中的對象。我正在尋找補償相機失真的方法,我使用了OpenCV校準工具並生成了具有相關參數的XML文件。OpenCV應用相機失真 - 應用校準
但是我不確定如何使用undistort
函數來應用這個函數,我的理解是這需要在捕獲每個幀時應用到每個幀上?
void undistort(InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray newCameraMatrix=noArray())
我無法確定這些參數,下面是我目前的理解。
undistorted(currentFrame, resultsWindow, calibrationFile, notSure, notSure);
這是函數調用如下:
if(captureOpen == false){
img_scene = cvCaptureFromFile(videoFeed);
}
while(1) {
image = cvQueryFrame(img_scene);
undistort();
檢查此答案http://stackoverflow.com/questions/19897414/understanding-opencvs-undistort-function – ikaro