1.opencv ransac算法的使用可以参考博客
http://blog.youkuaiyun.com/qq_25352981/article/details/46914837
http://blog.youkuaiyun.com/qq_25352981/article/details/46914837
2.
/**
* @brief This function computes the set of inliers estimating the fundamental matrix
* or a planar homography in a RANSAC procedure
* @param matches Vector of putative matches
* @param inliers Vector of inliers
* @param error The minimum pixelic error to accept an inlier
* @param use_fund Set to true if you want to compute a fundamental matrix
*/
void compute_inliers_ransac(const std::vector& matches,
std::vector& inliers,
float error, bool use_fund) {
vector<Point2f> points1, points2;
Mat H = Mat::zeros(3,3,CV_32F); //变换矩阵
int npoints = matches.size()/2;
Mat status = Mat::zeros(npo