FindFundamentalMatrix-mode CV_FM_7POINT won't give 3 solutions (Bug #1978)


Added by Pedro Cavestany almost 13 years ago. Updated about 12 years ago.


Status:Done Start date:2012-05-23
Priority:Normal Due date:2012-05-30
Assignee:Daniil Osokin % Done:

0%

Category:calibration, 3d
Target version:2.4.3 Estimated time:1.00 hour
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Hi, I've noticed that the C++ version of the method FindFundamentalMatrix(), in the file source:tags/2.4.0/opencv/modules/calib3d/src/fundam.cpp#L588, the mode CV_FM_7POINT doesn't work as it is supposed to do. The C version allocates a 9x3 matrix in the mode CV_FM_7POINT, in case 3 solutions are found. But the C++ version only allocates a 3x3 matrix, and then it calls to the C version. So, regardless the solution/s given by the C version, only one matrix will be filled.

The C++ call is:

 1cv::Mat cv::findFundamentalMat( InputArray _points1, InputArray _points2, int method, double param1, double aram2, OutputArray _mask )
 2
 3{
 4    Mat points1 = _points1.getMat(), points2 = _points2.getMat();
 5    int npoints = points1.checkVector(2);
 6    CV_Assert( npoints >= 0 && points2.checkVector(2) == npoints &&
 7              points1.type() == points2.type());
 8    Mat F(3, 3, CV_64F);
 9    CvMat _pt1 = points1, _pt2 = points2;
10    CvMat matF = F, c_mask, *p_mask = 0;
11    if( _mask.needed() )
12        {
13            _mask.create(npoints, 1, CV_8U, -1, true);
14            p_mask = &(c_mask = _mask.getMat());
15        }
16    int n = cvFindFundamentalMat( &_pt1, &_pt2, &matF, method, param1, param2, p_mask );
17    if( n <= 0 )
18        F = Scalar(0);
19    return F;
20}

I'd say that it should take into account that a matrix 9x3 is needed in mode CV_FM_7POINT.

Cheers,

Pedro


Associated revisions

Revision 4500c483
Added by Daniil Osokin over 12 years ago

fixed 7 point mode in findFundamentalMat #1978

Revision ac1c6dac
Added by Andrey Pavlenko about 11 years ago

Merge pull request #1978 from ilya-lavrenov:ocl_min_max

History

Updated by Andrey Kamaev almost 13 years ago

  • Target version deleted (2.4.1)
  • Description changed from Hi, I've noticed that the C++ version of the method FindFundamentalMatrix... to Hi, I've noticed that the C++ version of the method @FindFundamentalMatri... More
  • Assignee set to Vadim Pisarevsky

Updated by Vadim Pisarevsky over 12 years ago

  • Target version deleted ()

Updated by Vadim Pisarevsky over 12 years ago

  • Assignee deleted (Vadim Pisarevsky)

Updated by Daniil Osokin over 12 years ago

  • Assignee set to Daniil Osokin

Updated by Daniil Osokin over 12 years ago

Pedro, thank you. We've fixed it, hash: 4500c4.

  • Status changed from Open to Done

Updated by Andrey Kamaev about 12 years ago

  • Target version set to 2.4.3

Also available in: Atom PDF