Added a check that Q (computed by rectification) reprojects a point before the camera
This commit is contained in:
parent
b6ab96ae0b
commit
d9001d1a91
@ -1478,6 +1478,16 @@ void CV_StereoCalibrationTest::run( int )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check that Q reprojects points before the camera
|
||||||
|
double testPoint[4] = {0.0, 0.0, 100.0, 1.0};
|
||||||
|
Mat reprojectedTestPoint = Q * Mat_<double>(4, 1, testPoint);
|
||||||
|
CV_Assert(reprojectedTestPoint.type() == CV_64FC1);
|
||||||
|
if( reprojectedTestPoint.at<double>(2) / reprojectedTestPoint.at<double>(3) < 0 )
|
||||||
|
{
|
||||||
|
ts->printf( cvtest::TS::LOG, "A point after rectification is reprojected behind the camera, testcase %d\n", testcase);
|
||||||
|
ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT );
|
||||||
|
}
|
||||||
|
|
||||||
// rectifyUncalibrated
|
// rectifyUncalibrated
|
||||||
CV_Assert( imgpt1.size() == imgpt2.size() );
|
CV_Assert( imgpt1.size() == imgpt2.size() );
|
||||||
Mat _imgpt1( total, 1, CV_32FC2 ), _imgpt2( total, 1, CV_32FC2 );
|
Mat _imgpt1( total, 1, CV_32FC2 ), _imgpt2( total, 1, CV_32FC2 );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user