From 34bc3b859530baa5dddb6e6b2c47980bfd8dfbbe Mon Sep 17 00:00:00 2001 From: Deanna Hood Date: Thu, 23 Apr 2015 10:08:42 -0400 Subject: [PATCH 1/2] Don't relax error level for particular fundamental matrix calculation methods --- modules/calib3d/test/test_fundam.cpp | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/modules/calib3d/test/test_fundam.cpp b/modules/calib3d/test/test_fundam.cpp index 7eb12ad24b..5f8d30de40 100644 --- a/modules/calib3d/test/test_fundam.cpp +++ b/modules/calib3d/test/test_fundam.cpp @@ -973,26 +973,12 @@ int CV_FundamentalMatTest::prepare_test_case( int test_case_idx ) return code; } - void CV_FundamentalMatTest::run_func() { - //if(!test_cpp) - { - CvMat _input0 = test_mat[INPUT][0], _input1 = test_mat[INPUT][1]; - CvMat F = test_mat[TEMP][0], mask = test_mat[TEMP][1]; - f_result = cvFindFundamentalMat( &_input0, &_input1, &F, method, MAX(sigma*3, 0.01), 0, &mask ); - } - /*else - { - cv::findFundamentalMat(const Mat& points1, const Mat& points2, - vector& mask, int method=FM_RANSAC, - double param1=3., double param2=0.99 ); - - CV_EXPORTS Mat findFundamentalMat( const Mat& points1, const Mat& points2, - int method=FM_RANSAC, - double param1=3., double param2=0.99 ); - }*/ - + // cvFindFundamentalMat calls cv::findFundamentalMat + CvMat _input0 = test_mat[INPUT][0], _input1 = test_mat[INPUT][1]; + CvMat F = test_mat[TEMP][0], mask = test_mat[TEMP][1]; + f_result = cvFindFundamentalMat( &_input0, &_input1, &F, method, MAX(sigma*3, 0.01), 0, &mask ); } @@ -1022,7 +1008,7 @@ void CV_FundamentalMatTest::prepare_to_validation( int test_case_idx ) F0 *= 1./f0[8]; uchar* status = test_mat[TEMP][1].ptr(); - double err_level = method <= CV_FM_8POINT ? 1 : get_success_error_level( test_case_idx, OUTPUT, 1 ); + double err_level = get_success_error_level( test_case_idx, OUTPUT, 1 ); uchar* mtfm1 = test_mat[REF_OUTPUT][1].ptr(); uchar* mtfm2 = test_mat[OUTPUT][1].ptr(); double* f_prop1 = test_mat[REF_OUTPUT][0].ptr(); From eee210f3b502ec46b9c6e7a7a2df5a8f8b392b9a Mon Sep 17 00:00:00 2001 From: Deanna Hood Date: Thu, 23 Apr 2015 10:09:48 -0400 Subject: [PATCH 2/2] Fix Bug #3441, #4072, #4173: 8-point fundamental matrix calculation error --- modules/calib3d/src/fundam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/calib3d/src/fundam.cpp b/modules/calib3d/src/fundam.cpp index a97ed2c709..230182e8c9 100644 --- a/modules/calib3d/src/fundam.cpp +++ b/modules/calib3d/src/fundam.cpp @@ -641,7 +641,7 @@ static int run8Point( const Mat& _m1, const Mat& _m2, Mat& _fmatrix ) W.at(2) = 0.; // F0 <- U*diag([W(1), W(2), 0])*V' - gemm( U, Mat::diag(W), 1., 0, 0., TF, GEMM_1_T ); + gemm( U, Mat::diag(W), 1., 0, 0., TF, 0 ); gemm( TF, V, 1., 0, 0., F0, 0/*CV_GEMM_B_T*/ ); // apply the transformation that is inverse