star还不错,但是时间太久了,14年的,而且没有现成的例子
GitHub - guimeira/stereo-tuner: Parameter tuner for OpenCV stereo-matching algorithms
带调参界面的;
这个也有实现了rectify. 直接用这个就好了
GitHub - sourishg/stereo-calibration: Stereo camera calibration using OpenCV and C++
这个有从原始图像到最后rectify的完整过程
从原始图像到undistort和rectify的过程是:
cv::Mat lmapx, lmapy, rmapx, rmapy;
cv::Mat imgU1, imgU2;
cv::initUndistortRectifyMap(K1, D1, R1, P1, img1.size(), CV_32F, lmapx, lmapy);
cv::initUndistortRectifyMap(K2, D2, R2, P2, img2.size(), CV_32F, rmapx, rmapy);
cv::remap(img1, imgU1, lmapx, lmapy, cv::INTER_LINEAR);
cv::remap(img2, imgU2, rmapx, rmapy, cv::INTER_LINEAR);
imwrite(leftout_filename, imgU1);
imwrite(rightout_filename, imgU2);