Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Residual error from fundamental matrix

Hi guys,

as in the previous topics I made I'm still working on self calibration stuff. I'm generating the data for the evaluation but I end out with some strange error computing the residual error as defined here slide 31. But maybe I'm using the wrong function to compute the norm. The resulting residual error is absurd, while the epipolar equation x'Fx=0 give to me a residual of 0.25 so I suppose is almost perfect. I've points correspondences for image L and R and the fundamental matrix. Actually I'm doing in this way, I don't care that it isn't efficient since is not important, is just for data generation.

        cv::Mat temp_point_1 = cv::Mat(3,1,CV_64F);
        temp_point_1.at<double>(0,0) = featuresL.at(i).x;
        temp_point_1.at<double>(1,0) = featuresL.at(i).y;
        temp_point_1.at<double>(2,0) = 1;

        cv::Mat temp_point_2 = cv::Mat(3,1,CV_64F);
        temp_point_2.at<double>(0,0) = featuresR.at(i).x;
        temp_point_2.at<double>(1,0) = featuresR.at(i).y;
        temp_point_2.at<double>(2,0) = 1;
        double resError = cv::norm(temp_point_2-(fundamentalMat*temp_point_1)) 
                          + cv::norm(temp_point_1-(fundamentalMat.t()*temp_point_2));

I would like to find the residual error, is there any built in function to do that? I've looked on the documentation but I've not find it.

Residual error from fundamental matrix

Hi guys,

as in the previous topics I made I'm still working on self calibration stuff. I'm generating the data for the evaluation but I end out with some strange error computing the residual error as defined here slide 31. But maybe I'm using the wrong function to compute the norm. The resulting residual error is absurd, while the epipolar equation x'Fx=0 give to me a residual of 0.25 so I suppose is almost perfect. I've points correspondences for image L and R and the fundamental matrix. Actually I'm doing in this way, I don't care that it isn't efficient since is not important, is just for data generation.

 double resError;
        cv::Mat temp_point_1 = cv::Mat(3,1,CV_64F);
        temp_point_1.at<double>(0,0) = featuresL.at(i).x;
        temp_point_1.at<double>(1,0) = featuresL.at(i).y;
        temp_point_1.at<double>(2,0) = 1;

        cv::Mat temp_point_2 = cv::Mat(3,1,CV_64F);
        temp_point_2.at<double>(0,0) = featuresR.at(i).x;
        temp_point_2.at<double>(1,0) = featuresR.at(i).y;
        temp_point_2.at<double>(2,0) = 1;
        double resError = += cv::norm(temp_point_2-(fundamentalMat*temp_point_1)) 
                          + cv::norm(temp_point_1-(fundamentalMat.t()*temp_point_2));

I would like to find the residual error, is there any built in function to do that? I've looked on the documentation but I've not find it.

Residual error from fundamental matrix

Hi guys,

as in the previous topics I made I'm still working on self calibration stuff. I'm generating the data for the evaluation but I end out with some strange error computing the residual error as defined here slide 31. But maybe I'm using the wrong function to compute the norm. The resulting residual error is absurd, while the epipolar equation x'Fx=0 give to me a residual of 0.25 so I suppose is almost perfect. perfect.

I've points correspondences for image L and R and the fundamental matrix. Actually I'm doing in this way, I don't care that it isn't efficient since is not important, is just for data generation.

        double resError;
        cv::Mat temp_point_1 = cv::Mat(3,1,CV_64F);
        temp_point_1.at<double>(0,0) = featuresL.at(i).x;
        temp_point_1.at<double>(1,0) = featuresL.at(i).y;
        temp_point_1.at<double>(2,0) = 1;

        cv::Mat temp_point_2 = cv::Mat(3,1,CV_64F);
        temp_point_2.at<double>(0,0) = featuresR.at(i).x;
        temp_point_2.at<double>(1,0) = featuresR.at(i).y;
        temp_point_2.at<double>(2,0) = 1;
        resError += cv::norm(temp_point_2-(fundamentalMat*temp_point_1)) 
                          + cv::norm(temp_point_1-(fundamentalMat.t()*temp_point_2));

I would like to find the residual error, is there any built in function to do that? I've looked on the documentation but I've not find it.

EDIT: the result I'm getting are the following:

Residual of F 0.250138
Mean residual of F 0.0039084
F RESIDUAL ERROR: 65237.2

where:

  • Residual of F is computed using the epipolar geometry x'Fx=0
  • mean error is the previous value divided by the number of inliers used for estimating the fundamental matrix
  • The last one (F RESIDUAL ERROR) is the one that is wrong and that I'm asking about

Residual error from fundamental matrix

Hi guys,

as in the previous topics I made I'm still working on self calibration stuff. I'm generating the data for the evaluation but I end out with some strange error computing the residual error as defined here slide 31. But maybe I'm using the wrong function to compute the norm. The resulting residual error is absurd, while the epipolar equation x'Fx=0 give to me a residual of 0.25 so I suppose is almost perfect.

I've points correspondences for image L and R and the fundamental matrix. Actually I'm doing in this way, I don't care that it isn't efficient since is not important, is just for data generation.

        double resError;
for(int i=0; i<maskInliers.rows; i++)
 {
    if((uchar)maskInliers.at<uchar>(i) == 1)
    {   
        inliersL.push_back(featuresL.at(i));
        inliersR.push_back(featuresR.at(i));

        cv::Mat temp_point_1 = cv::Mat(3,1,CV_64F);
        temp_point_1.at<double>(0,0) = featuresL.at(i).x;
        temp_point_1.at<double>(1,0) = featuresL.at(i).y;
        temp_point_1.at<double>(2,0) = 1;

        cv::Mat temp_point_2 = cv::Mat(3,1,CV_64F);
        temp_point_2.at<double>(0,0) = featuresR.at(i).x;
        temp_point_2.at<double>(1,0) = featuresR.at(i).y;
        temp_point_2.at<double>(2,0) = 1;
 
        /*******************************
        * COMPUTING THE F RESIDUALS
        *******************************/
        //Epipolar equation x'Fx=0
        cv::Mat tempResF = temp_point_2.t()*fundamentalMat*temp_point_1;
        residualF += fabs(tempResF.at<double>(0,0));

        //Residual error
        double resError = cv::norm(temp_point_2-(fundamentalMat*temp_point_1)) + 
                     cv::norm(temp_point_1-(fundamentalMat.t()*temp_point_2));
        residualF_error += cv::norm(temp_point_2-(fundamentalMat*temp_point_1)) 
                          + cv::norm(temp_point_1-(fundamentalMat.t()*temp_point_2));
resError;
     }
 }

I would like to find the residual error, is there any built in function to do that? I've looked on the documentation but I've not find it.

EDIT: the result I'm getting are the following:

Residual of F 0.250138
Mean residual of F 0.0039084
F RESIDUAL ERROR: 65237.2

where:

  • Residual of F is computed using the epipolar geometry x'Fx=0
  • mean error is the previous value divided by the number of inliers used for estimating the fundamental matrix
  • The last one (F RESIDUAL ERROR) is the one that is wrong and that I'm asking about