我有一个程序,检测实时视频流中的对象。我正在寻找补偿相机失真的方法,我使用了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