mirror of
https://github.com/opencv/opencv.git
synced 2025-06-28 07:23:30 +08:00
Fix cameracalibration test
* Remove transpose for rvec after calibration * Change compare threshold from 110% to 10% for perViewErrors * Add transpose to goodRotMatrs load
This commit is contained in:
parent
7e845a3b87
commit
50bf0e10f5
@ -484,7 +484,8 @@ void CV_CameraCalibrationTest::run( int start_from )
|
|||||||
for( i = 0; i < 3; i++ )
|
for( i = 0; i < 3; i++ )
|
||||||
for( j = 0; j < 3; j++ )
|
for( j = 0; j < 3; j++ )
|
||||||
{
|
{
|
||||||
values_read = fscanf(file, "%lf", &goodRotMatrs[currImage].val[i*3+j]);
|
// Yes, load with transpose
|
||||||
|
values_read = fscanf(file, "%lf", &goodRotMatrs[currImage].val[j*3+i]);
|
||||||
CV_Assert(values_read == 1);
|
CV_Assert(values_read == 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -661,7 +662,7 @@ void CV_CameraCalibrationTest::run( int start_from )
|
|||||||
|
|
||||||
/* ----- Compare per view re-projection errors ----- */
|
/* ----- Compare per view re-projection errors ----- */
|
||||||
CV_Assert(perViewErrors.size() == (size_t)numImages);
|
CV_Assert(perViewErrors.size() == (size_t)numImages);
|
||||||
code = compare(&perViewErrors[0], &goodPerViewErrors[0], numImages, 1.1, "per view errors vector");
|
code = compare(&perViewErrors[0], &goodPerViewErrors[0], numImages, 0.1, "per view errors vector");
|
||||||
if( code < 0 )
|
if( code < 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -792,7 +793,6 @@ void CV_CameraCalibrationTest_CPP::calibrate(Size imageSize,
|
|||||||
{
|
{
|
||||||
Mat r9;
|
Mat r9;
|
||||||
cvtest::Rodrigues( rvecs[i], r9 );
|
cvtest::Rodrigues( rvecs[i], r9 );
|
||||||
cv::transpose(r9, r9);
|
|
||||||
r9.convertTo(rotationMatrices[i], CV_64F);
|
r9.convertTo(rotationMatrices[i], CV_64F);
|
||||||
tvecs[i].convertTo(translationVectors[i], CV_64F);
|
tvecs[i].convertTo(translationVectors[i], CV_64F);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user