8-point fundamental matrix estimation seems to be broken (Bug #3441)


Added by Alexander Mordvintsev about 11 years ago. Updated almost 10 years ago.


Status:Done Start date:2013-12-18
Priority:High Due date:
Assignee:Vadim Pisarevsky % Done:

100%

Category:calibration, 3d
Target version:3.0
Affected version:branch 'master' (3.0-dev) Operating System:Windows
Difficulty: HW Platform:x64
Pull request:

Description

The attached test_rectify.py script generates a synthetic set of image matches and tries to recover the fundamental matrix with "findFundamentalMat". FM_RANSAC method succeeds, but FM_8POINT fails to give correct answer (which leads to crash on rectification). Data is synthetic and shouldn't contain any outliers.


test_rectify.py (1.9 kB) Alexander Mordvintsev, 2013-12-18 01:20 pm


Related issues

duplicated by Bug #4072: Fundamental Matrix Calculation Done 2014-12-17
duplicated by Bug #4173: 8 point algorithm bug Done 2015-02-05
duplicated by Bug #4186: findFundamentalMat is returning wrong results with FM_8PO... Done 2015-02-09

Associated revisions

Revision eee210f3
Added by Deanna Hood almost 10 years ago

Fix Bug #3441, #4072, #4173: 8-point fundamental matrix calculation error

History

Updated by Anna Kogan about 11 years ago

Hello Alexander,

Thank you for reporting the problem and especially for providing the reproducer for it. If you could work on a solution for the issue on your side, a contribution (see How_to_contribute) would be very appreciated!

Updated by Andrew Senin about 11 years ago

  • Assignee changed from Vadim Pisarevsky to Alexander Mordvintsev
  • Status changed from New to Open

Updated by Vadim Pisarevsky about 10 years ago

  • Assignee changed from Alexander Mordvintsev to Vadim Pisarevsky

Updated by Vadim Pisarevsky about 10 years ago

  • Priority changed from Normal to High
  • Target version set to 3.0

Updated by Jon Waltman about 10 years ago

I would like this fixed too, please! It looks like bug reports #4072 and #4173 suggest the same fix (posted by the same guy).

Updated by Jon Waltman almost 10 years ago

I have verified that the fix mentioned above (and copied below) corrects the issue. For reference, Can Cagman said in bug report #4173:

fundam.cpp - run8Point()
line: 576
gemm( U, Mat::diag(W), 1., 0, 0., TF, GEMM_1_T );
should be changed to
gemm( U, Mat::diag(W), 1., 0, 0., TF, 0);

This is because the SVD call in OpenCV 3.0b fundam.cpp:
SVDecomp( F0, W, U, V, SVD::MODIFY_A );
returns a U matrix that is the transpose of that in OpenCV 2.4.9:
cvSVD( &F0, &W, &U, &V, CV_SVD_MODIFY_A + CV_SVD_U_T + CV_SVD_V_T );
This appears to be the case due to a different set of flags input to the SVD call.

Anyways, the quoted fix above corrects the issue and makes OpenCV 3.0b return the same (correct) results for the 8-point algorithm as OpenCV 2.4.9.

Updated by Deanna Hood almost 10 years ago

  • Status changed from Open to Done
  • % Done changed from 0 to 100

Also available in: Atom PDF