From c5fa70143d2777c0abe32694ba770cdebb7474e3 Mon Sep 17 00:00:00 2001 From: Alexander Shishkov Date: Fri, 3 Jun 2011 07:57:07 +0000 Subject: [PATCH] added check input data --- modules/video/test/test_estimaterigid.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/video/test/test_estimaterigid.cpp b/modules/video/test/test_estimaterigid.cpp index c69fbf2..c8f0f15 100644 --- a/modules/video/test/test_estimaterigid.cpp +++ b/modules/video/test/test_estimaterigid.cpp @@ -135,7 +135,14 @@ bool CV_RigidTransform_Test::testNPoints(int from) bool CV_RigidTransform_Test::testImage() { Mat img; - pyrDown(imread( string(ts->get_data_path()) + "shared/graffiti.png", 1), img); + Mat testImg = imread( string(ts->get_data_path()) + "shared/graffiti.png", 1); + if (testImg.empty()) + { + ts->printf( ts->LOG, "test image can not be read"); + ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA); + return false; + } + pyrDown(testImg, img); Mat aff = cv::getRotationMatrix2D(Point(img.cols/2, img.rows/2), 1, 0.99); aff.ptr()[2]+=3; -- 2.7.4