Merge pull request #1915 from jet47:gpu-color-test-fix

This commit is contained in:
Roman Donchenko 2013-12-04 13:55:28 +04:00 committed by OpenCV Buildbot
commit fa2cd93ecf
2 changed files with 9 additions and 1 deletions

View File

@ -1863,7 +1863,7 @@ void cv::gpu::demosaicing(const GpuMat& src, GpuMat& dst, int code, int dcn, Str
{ {
const int depth = src.depth(); const int depth = src.depth();
CV_Assert( src.channels() == 1 ); CV_Assert( src.channels() == 1 && !src.empty() );
switch (code) switch (code)
{ {

View File

@ -2357,6 +2357,7 @@ struct Demosaicing : testing::TestWithParam<cv::gpu::DeviceInfo>
GPU_TEST_P(Demosaicing, BayerBG2BGR) GPU_TEST_P(Demosaicing, BayerBG2BGR)
{ {
cv::Mat img = readImage("stereobm/aloe-L.png"); cv::Mat img = readImage("stereobm/aloe-L.png");
ASSERT_FALSE(img.empty()) << "Can't load input image";
cv::Mat_<uchar> src; cv::Mat_<uchar> src;
mosaic(img, src, cv::Point(1, 1)); mosaic(img, src, cv::Point(1, 1));
@ -2370,6 +2371,7 @@ GPU_TEST_P(Demosaicing, BayerBG2BGR)
GPU_TEST_P(Demosaicing, BayerGB2BGR) GPU_TEST_P(Demosaicing, BayerGB2BGR)
{ {
cv::Mat img = readImage("stereobm/aloe-L.png"); cv::Mat img = readImage("stereobm/aloe-L.png");
ASSERT_FALSE(img.empty()) << "Can't load input image";
cv::Mat_<uchar> src; cv::Mat_<uchar> src;
mosaic(img, src, cv::Point(0, 1)); mosaic(img, src, cv::Point(0, 1));
@ -2383,6 +2385,7 @@ GPU_TEST_P(Demosaicing, BayerGB2BGR)
GPU_TEST_P(Demosaicing, BayerRG2BGR) GPU_TEST_P(Demosaicing, BayerRG2BGR)
{ {
cv::Mat img = readImage("stereobm/aloe-L.png"); cv::Mat img = readImage("stereobm/aloe-L.png");
ASSERT_FALSE(img.empty()) << "Can't load input image";
cv::Mat_<uchar> src; cv::Mat_<uchar> src;
mosaic(img, src, cv::Point(0, 0)); mosaic(img, src, cv::Point(0, 0));
@ -2396,6 +2399,7 @@ GPU_TEST_P(Demosaicing, BayerRG2BGR)
GPU_TEST_P(Demosaicing, BayerGR2BGR) GPU_TEST_P(Demosaicing, BayerGR2BGR)
{ {
cv::Mat img = readImage("stereobm/aloe-L.png"); cv::Mat img = readImage("stereobm/aloe-L.png");
ASSERT_FALSE(img.empty()) << "Can't load input image";
cv::Mat_<uchar> src; cv::Mat_<uchar> src;
mosaic(img, src, cv::Point(1, 0)); mosaic(img, src, cv::Point(1, 0));
@ -2409,6 +2413,7 @@ GPU_TEST_P(Demosaicing, BayerGR2BGR)
GPU_TEST_P(Demosaicing, BayerBG2BGR_MHT) GPU_TEST_P(Demosaicing, BayerBG2BGR_MHT)
{ {
cv::Mat img = readImage("stereobm/aloe-L.png"); cv::Mat img = readImage("stereobm/aloe-L.png");
ASSERT_FALSE(img.empty()) << "Can't load input image";
cv::Mat_<uchar> src; cv::Mat_<uchar> src;
mosaic(img, src, cv::Point(1, 1)); mosaic(img, src, cv::Point(1, 1));
@ -2422,6 +2427,7 @@ GPU_TEST_P(Demosaicing, BayerBG2BGR_MHT)
GPU_TEST_P(Demosaicing, BayerGB2BGR_MHT) GPU_TEST_P(Demosaicing, BayerGB2BGR_MHT)
{ {
cv::Mat img = readImage("stereobm/aloe-L.png"); cv::Mat img = readImage("stereobm/aloe-L.png");
ASSERT_FALSE(img.empty()) << "Can't load input image";
cv::Mat_<uchar> src; cv::Mat_<uchar> src;
mosaic(img, src, cv::Point(0, 1)); mosaic(img, src, cv::Point(0, 1));
@ -2435,6 +2441,7 @@ GPU_TEST_P(Demosaicing, BayerGB2BGR_MHT)
GPU_TEST_P(Demosaicing, BayerRG2BGR_MHT) GPU_TEST_P(Demosaicing, BayerRG2BGR_MHT)
{ {
cv::Mat img = readImage("stereobm/aloe-L.png"); cv::Mat img = readImage("stereobm/aloe-L.png");
ASSERT_FALSE(img.empty()) << "Can't load input image";
cv::Mat_<uchar> src; cv::Mat_<uchar> src;
mosaic(img, src, cv::Point(0, 0)); mosaic(img, src, cv::Point(0, 0));
@ -2448,6 +2455,7 @@ GPU_TEST_P(Demosaicing, BayerRG2BGR_MHT)
GPU_TEST_P(Demosaicing, BayerGR2BGR_MHT) GPU_TEST_P(Demosaicing, BayerGR2BGR_MHT)
{ {
cv::Mat img = readImage("stereobm/aloe-L.png"); cv::Mat img = readImage("stereobm/aloe-L.png");
ASSERT_FALSE(img.empty()) << "Can't load input image";
cv::Mat_<uchar> src; cv::Mat_<uchar> src;
mosaic(img, src, cv::Point(1, 0)); mosaic(img, src, cv::Point(1, 0));