From e5d1b9eecd7d1001d2ecf5ba17bdf61b86a5efa9 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 27 Dec 2010 10:00:26 +0000 Subject: [PATCH] another attempt to fix findHomography --- modules/calib3d/src/fundam.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/calib3d/src/fundam.cpp b/modules/calib3d/src/fundam.cpp index c7e1f8b..41e648f 100644 --- a/modules/calib3d/src/fundam.cpp +++ b/modules/calib3d/src/fundam.cpp @@ -260,10 +260,7 @@ cvFindHomography( const CvMat* objectPoints, const CvMat* imagePoints, if( method == CV_LMEDS ) result = estimator.runLMeDS( M, m, &matH, tempMask, confidence, maxIters ); else if( method == CV_RANSAC ) - { result = estimator.runRANSAC( M, m, &matH, tempMask, ransacReprojThreshold, confidence, maxIters); - estimator.runKernel( M, m, &matH ); - } else result = estimator.runKernel( M, m, &matH ) > 0; @@ -272,6 +269,8 @@ cvFindHomography( const CvMat* objectPoints, const CvMat* imagePoints, icvCompressPoints( (CvPoint2D64f*)M->data.ptr, tempMask->data.ptr, 1, count ); count = icvCompressPoints( (CvPoint2D64f*)m->data.ptr, tempMask->data.ptr, 1, count ); M->cols = m->cols = count; + if( method == CV_RANSAC ) + estimator.runKernel( M, m, &matH ); estimator.refine( M, m, &matH, 10 ); } -- 2.7.4