Added test for the asymmetric pattern detection

This commit is contained in:
Ilya Lysenkov 2011-02-07 08:01:20 +00:00
parent 4d65de173e
commit d8488e778c

View File

@ -74,7 +74,7 @@ void show_points( const Mat& gray, const Mat& u, const vector<Point2f>& v, Size
} }
enum Pattern { CHESSBOARD, CIRCLES_GRID }; enum Pattern { CHESSBOARD, CIRCLES_GRID, ASYMMETRIC_CIRCLES_GRID };
class CV_ChessboardDetectorTest : public CvTest class CV_ChessboardDetectorTest : public CvTest
{ {
@ -149,6 +149,9 @@ void CV_ChessboardDetectorTest::run( int /*start_from */)
case CIRCLES_GRID: case CIRCLES_GRID:
run_batch("circles_list.dat"); run_batch("circles_list.dat");
break; break;
case ASYMMETRIC_CIRCLES_GRID:
run_batch("acircles_list.dat");
break;
} }
} }
@ -171,6 +174,9 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename )
case CIRCLES_GRID: case CIRCLES_GRID:
folder = string(ts.get_data_path()) + "cameracalibration/circles/"; folder = string(ts.get_data_path()) + "cameracalibration/circles/";
break; break;
case ASYMMETRIC_CIRCLES_GRID:
folder = string(ts.get_data_path()) + "cameracalibration/asymmetric_circles/";
break;
} }
FileStorage fs( folder + filename, FileStorage::READ ); FileStorage fs( folder + filename, FileStorage::READ );
@ -229,7 +235,10 @@ void CV_ChessboardDetectorTest::run_batch( const string& filename )
result = findChessboardCorners(gray, pattern_size, v, CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_NORMALIZE_IMAGE); result = findChessboardCorners(gray, pattern_size, v, CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_NORMALIZE_IMAGE);
break; break;
case CIRCLES_GRID: case CIRCLES_GRID:
result = findCirclesGrid(gray, pattern_size, v); result = findCirclesGrid(gray, pattern_size, v, CALIB_CB_SYMMETRIC_GRID);
break;
case ASYMMETRIC_CIRCLES_GRID:
result = findCirclesGrid(gray, pattern_size, v, CALIB_CB_ASYMMETRIC_GRID);
break; break;
} }
show_points( gray, Mat(), v, pattern_size, result ); show_points( gray, Mat(), v, pattern_size, result );
@ -441,5 +450,6 @@ bool CV_ChessboardDetectorTest::checkByGenerator()
CV_ChessboardDetectorTest chessboard_detector_test ( CHESSBOARD, "chessboard-detector", "cvFindChessboardCorners" ); CV_ChessboardDetectorTest chessboard_detector_test ( CHESSBOARD, "chessboard-detector", "cvFindChessboardCorners" );
CV_ChessboardDetectorTest circlesgrid_detector_test ( CIRCLES_GRID, "circlesgrid-detector", "findCirclesGrid" ); CV_ChessboardDetectorTest circlesgrid_detector_test ( CIRCLES_GRID, "circlesgrid-detector", "findCirclesGrid" );
CV_ChessboardDetectorTest asymmetric_circlesgrid_detector_test ( ASYMMETRIC_CIRCLES_GRID, "asymmetric-circlesgrid-detector", "findCirclesGrid" );
/* End of file. */ /* End of file. */