|
|
|
@ -121,149 +121,65 @@ PARAM_TEST_CASE(CvtColor, MatDepth, bool) |
|
|
|
|
|
|
|
|
|
#define CVTCODE(name) COLOR_ ## name |
|
|
|
|
|
|
|
|
|
// RGB <-> Gray
|
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor, RGB2GRAY) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 1, CVTCODE(RGB2GRAY)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, GRAY2RGB) |
|
|
|
|
{ |
|
|
|
|
doTest(1, 3, CVTCODE(GRAY2RGB)); |
|
|
|
|
} |
|
|
|
|
// RGB[A] <-> BGR[A]
|
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor, BGR2BGRA) { doTest(3, 4, CVTCODE(BGR2BGRA)); } |
|
|
|
|
OCL_TEST_P(CvtColor, RGB2RGBA) { doTest(3, 4, CVTCODE(BGR2BGRA)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2BGR) { doTest(4, 3, CVTCODE(BGRA2BGR)); } |
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2RGB) { doTest(4, 3, CVTCODE(BGRA2BGR)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGR2RGBA) { doTest(3, 4, CVTCODE(BGR2RGBA)); } |
|
|
|
|
OCL_TEST_P(CvtColor, RGB2BGRA) { doTest(3, 4, CVTCODE(BGR2RGBA)); } |
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2BGR) { doTest(4, 3, CVTCODE(RGBA2BGR)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2RGB) { doTest(4, 3, CVTCODE(RGBA2BGR)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGR2RGB) { doTest(3, 3, CVTCODE(BGR2RGB)); } |
|
|
|
|
OCL_TEST_P(CvtColor, RGB2BGR) { doTest(3, 3, CVTCODE(BGR2RGB)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2RGBA) { doTest(4, 4, CVTCODE(BGRA2RGBA)); } |
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2BGRA) { doTest(4, 4, CVTCODE(BGRA2RGBA)); } |
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor, BGR2GRAY) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 1, CVTCODE(BGR2GRAY)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, GRAY2BGR) |
|
|
|
|
{ |
|
|
|
|
doTest(1, 3, CVTCODE(GRAY2BGR)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2GRAY) |
|
|
|
|
{ |
|
|
|
|
doTest(4, 1, CVTCODE(RGBA2GRAY)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, GRAY2RGBA) |
|
|
|
|
{ |
|
|
|
|
doTest(1, 4, CVTCODE(GRAY2RGBA)); |
|
|
|
|
} |
|
|
|
|
// RGB <-> Gray
|
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2GRAY) |
|
|
|
|
{ |
|
|
|
|
doTest(4, 1, CVTCODE(BGRA2GRAY)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, GRAY2BGRA) |
|
|
|
|
{ |
|
|
|
|
doTest(1, 4, CVTCODE(GRAY2BGRA)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, RGB2GRAY) { doTest(3, 1, CVTCODE(RGB2GRAY)); } |
|
|
|
|
OCL_TEST_P(CvtColor, GRAY2RGB) { doTest(1, 3, CVTCODE(GRAY2RGB)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGR2GRAY) { doTest(3, 1, CVTCODE(BGR2GRAY)); } |
|
|
|
|
OCL_TEST_P(CvtColor, GRAY2BGR) { doTest(1, 3, CVTCODE(GRAY2BGR)); } |
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2GRAY) { doTest(4, 1, CVTCODE(RGBA2GRAY)); } |
|
|
|
|
OCL_TEST_P(CvtColor, GRAY2RGBA) { doTest(1, 4, CVTCODE(GRAY2RGBA)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2GRAY) { doTest(4, 1, CVTCODE(BGRA2GRAY)); } |
|
|
|
|
OCL_TEST_P(CvtColor, GRAY2BGRA) { doTest(1, 4, CVTCODE(GRAY2BGRA)); } |
|
|
|
|
|
|
|
|
|
// RGB <-> YUV
|
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor, RGB2YUV) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(RGB2YUV)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, BGR2YUV) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(BGR2YUV)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2YUV) |
|
|
|
|
{ |
|
|
|
|
doTest(4, 3, CVTCODE(RGB2YUV)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2YUV) |
|
|
|
|
{ |
|
|
|
|
doTest(4, 3, CVTCODE(BGR2YUV)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, YUV2RGB) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(YUV2RGB)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, YUV2BGR) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(YUV2BGR)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, YUV2RGBA) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 4, CVTCODE(YUV2RGB)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, YUV2BGRA) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 4, CVTCODE(YUV2BGR)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, RGB2YUV) { doTest(3, 3, CVTCODE(RGB2YUV)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGR2YUV) { doTest(3, 3, CVTCODE(BGR2YUV)); } |
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2YUV) { doTest(4, 3, CVTCODE(RGB2YUV)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2YUV) { doTest(4, 3, CVTCODE(BGR2YUV)); } |
|
|
|
|
OCL_TEST_P(CvtColor, YUV2RGB) { doTest(3, 3, CVTCODE(YUV2RGB)); } |
|
|
|
|
OCL_TEST_P(CvtColor, YUV2BGR) { doTest(3, 3, CVTCODE(YUV2BGR)); } |
|
|
|
|
OCL_TEST_P(CvtColor, YUV2RGBA) { doTest(3, 4, CVTCODE(YUV2RGB)); } |
|
|
|
|
OCL_TEST_P(CvtColor, YUV2BGRA) { doTest(3, 4, CVTCODE(YUV2BGR)); } |
|
|
|
|
|
|
|
|
|
// RGB <-> YCrCb
|
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor, RGB2YCrCb) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(RGB2YCrCb)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, BGR2YCrCb) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(BGR2YCrCb)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2YCrCb) |
|
|
|
|
{ |
|
|
|
|
doTest(4, 3, CVTCODE(RGB2YCrCb)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2YCrCb) |
|
|
|
|
{ |
|
|
|
|
doTest(4, 3, CVTCODE(BGR2YCrCb)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, YCrCb2RGB) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(YCrCb2RGB)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, YCrCb2BGR) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(YCrCb2BGR)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, YCrCb2RGBA) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 4, CVTCODE(YCrCb2RGB)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, YCrCb2BGRA) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 4, CVTCODE(YCrCb2BGR)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, RGB2YCrCb) { doTest(3, 3, CVTCODE(RGB2YCrCb)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGR2YCrCb) { doTest(3, 3, CVTCODE(BGR2YCrCb)); } |
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2YCrCb) { doTest(4, 3, CVTCODE(RGB2YCrCb)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2YCrCb) { doTest(4, 3, CVTCODE(BGR2YCrCb)); } |
|
|
|
|
OCL_TEST_P(CvtColor, YCrCb2RGB) { doTest(3, 3, CVTCODE(YCrCb2RGB)); } |
|
|
|
|
OCL_TEST_P(CvtColor, YCrCb2BGR) { doTest(3, 3, CVTCODE(YCrCb2BGR)); } |
|
|
|
|
OCL_TEST_P(CvtColor, YCrCb2RGBA) { doTest(3, 4, CVTCODE(YCrCb2RGB)); } |
|
|
|
|
OCL_TEST_P(CvtColor, YCrCb2BGRA) { doTest(3, 4, CVTCODE(YCrCb2BGR)); } |
|
|
|
|
|
|
|
|
|
// RGB <-> XYZ
|
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor, RGB2XYZ) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(RGB2XYZ)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, BGR2XYZ) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(BGR2XYZ)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2XYZ) |
|
|
|
|
{ |
|
|
|
|
doTest(4, 3, CVTCODE(RGB2XYZ)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2XYZ) |
|
|
|
|
{ |
|
|
|
|
doTest(4, 3, CVTCODE(BGR2XYZ)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, RGB2XYZ) { doTest(3, 3, CVTCODE(RGB2XYZ)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGR2XYZ) { doTest(3, 3, CVTCODE(BGR2XYZ)); } |
|
|
|
|
OCL_TEST_P(CvtColor, RGBA2XYZ) { doTest(4, 3, CVTCODE(RGB2XYZ)); } |
|
|
|
|
OCL_TEST_P(CvtColor, BGRA2XYZ) { doTest(4, 3, CVTCODE(BGR2XYZ)); } |
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor, XYZ2RGB) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(XYZ2RGB)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, XYZ2BGR) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 3, CVTCODE(XYZ2BGR)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, XYZ2RGBA) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 4, CVTCODE(XYZ2RGB)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, XYZ2BGRA) |
|
|
|
|
{ |
|
|
|
|
doTest(3, 4, CVTCODE(XYZ2BGR)); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor, XYZ2RGB) { doTest(3, 3, CVTCODE(XYZ2RGB)); } |
|
|
|
|
OCL_TEST_P(CvtColor, XYZ2BGR) { doTest(3, 3, CVTCODE(XYZ2BGR)); } |
|
|
|
|
OCL_TEST_P(CvtColor, XYZ2RGBA) { doTest(3, 4, CVTCODE(XYZ2RGB)); } |
|
|
|
|
OCL_TEST_P(CvtColor, XYZ2BGRA) { doTest(3, 4, CVTCODE(XYZ2BGR)); } |
|
|
|
|
|
|
|
|
|
// YUV -> RGBA_NV12
|
|
|
|
|
|
|
|
|
@ -289,25 +205,10 @@ struct CvtColor_YUV420 : |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor_YUV420, YUV2RGBA_NV12) |
|
|
|
|
{ |
|
|
|
|
doTest(1, 4, CV_YUV2RGBA_NV12); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor_YUV420, YUV2BGRA_NV12) |
|
|
|
|
{ |
|
|
|
|
doTest(1, 4, CV_YUV2BGRA_NV12); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor_YUV420, YUV2RGB_NV12) |
|
|
|
|
{ |
|
|
|
|
doTest(1, 3, CV_YUV2RGB_NV12); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
OCL_TEST_P(CvtColor_YUV420, YUV2BGR_NV12) |
|
|
|
|
{ |
|
|
|
|
doTest(1, 3, CV_YUV2BGR_NV12); |
|
|
|
|
} |
|
|
|
|
OCL_TEST_P(CvtColor_YUV420, YUV2RGBA_NV12) { doTest(1, 4, CV_YUV2RGBA_NV12); } |
|
|
|
|
OCL_TEST_P(CvtColor_YUV420, YUV2BGRA_NV12) { doTest(1, 4, CV_YUV2BGRA_NV12); } |
|
|
|
|
OCL_TEST_P(CvtColor_YUV420, YUV2RGB_NV12) { doTest(1, 3, CV_YUV2RGB_NV12); } |
|
|
|
|
OCL_TEST_P(CvtColor_YUV420, YUV2BGR_NV12) { doTest(1, 3, CV_YUV2BGR_NV12); } |
|
|
|
|
|
|
|
|
|
INSTANTIATE_TEST_CASE_P(OCL_ImgProc, CvtColor, |
|
|
|
|
testing::Combine( |
|
|
|
|