mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Merge pull request #3328 from ilya-lavrenov:warp_tests
This commit is contained in:
commit
c37acef077
@ -89,7 +89,7 @@ protected:
|
||||
|
||||
Size randSize(RNG& rng) const;
|
||||
|
||||
const char* interpolation_to_string(int inter_type) const;
|
||||
String interpolation_to_string(int inter_type) const;
|
||||
|
||||
int interpolation;
|
||||
Mat src;
|
||||
@ -109,21 +109,29 @@ CV_ImageWarpBaseTest::~CV_ImageWarpBaseTest()
|
||||
{
|
||||
}
|
||||
|
||||
const char* CV_ImageWarpBaseTest::interpolation_to_string(int inter) const
|
||||
String CV_ImageWarpBaseTest::interpolation_to_string(int inter) const
|
||||
{
|
||||
bool inverse = (inter & WARP_INVERSE_MAP) != 0;
|
||||
inter &= ~WARP_INVERSE_MAP;
|
||||
String str;
|
||||
|
||||
if (inter == INTER_NEAREST)
|
||||
return "INTER_NEAREST";
|
||||
if (inter == INTER_LINEAR)
|
||||
return "INTER_LINEAR";
|
||||
if (inter == INTER_AREA)
|
||||
return "INTER_AREA";
|
||||
if (inter == INTER_CUBIC)
|
||||
return "INTER_CUBIC";
|
||||
if (inter == INTER_LANCZOS4)
|
||||
return "INTER_LANCZOS4";
|
||||
if (inter == INTER_LANCZOS4 + 1)
|
||||
return "INTER_AREA_FAST";
|
||||
return "Unsupported/Unkown interpolation type";
|
||||
str = "INTER_NEAREST";
|
||||
else if (inter == INTER_LINEAR)
|
||||
str = "INTER_LINEAR";
|
||||
else if (inter == INTER_AREA)
|
||||
str = "INTER_AREA";
|
||||
else if (inter == INTER_CUBIC)
|
||||
str = "INTER_CUBIC";
|
||||
else if (inter == INTER_LANCZOS4)
|
||||
str = "INTER_LANCZOS4";
|
||||
else if (inter == INTER_LANCZOS4 + 1)
|
||||
str = "INTER_AREA_FAST";
|
||||
|
||||
if (inverse)
|
||||
str += " | WARP_INVERSE_MAP";
|
||||
|
||||
return str.empty() ? "Unsupported/Unkown interpolation type" : str;
|
||||
}
|
||||
|
||||
Size CV_ImageWarpBaseTest::randSize(RNG& rng) const
|
||||
@ -271,7 +279,7 @@ void CV_ImageWarpBaseTest::validate_results() const
|
||||
scale_x = cvRound(scale_x);
|
||||
}
|
||||
|
||||
PRINT_TO_LOG("Interpolation: %s\n", interpolation_to_string(area_fast ? INTER_LANCZOS4 + 1 : interpolation));
|
||||
PRINT_TO_LOG("Interpolation: %s\n", interpolation_to_string(area_fast ? INTER_LANCZOS4 + 1 : interpolation).c_str());
|
||||
PRINT_TO_LOG("Scale (x, y): (%lf, %lf)\n", scale_x, scale_y);
|
||||
PRINT_TO_LOG("Elemsize: %d\n", src.elemSize1());
|
||||
PRINT_TO_LOG("Channels: %d\n", cn);
|
||||
@ -769,6 +777,10 @@ const char* CV_Remap_Test::borderType_to_string() const
|
||||
return "BORDER_REPLICATE";
|
||||
if (borderType == BORDER_REFLECT)
|
||||
return "BORDER_REFLECT";
|
||||
if (borderType == BORDER_WRAP)
|
||||
return "BORDER_WRAP";
|
||||
if (borderType == BORDER_REFLECT_101)
|
||||
return "BORDER_REFLECT_101";
|
||||
return "Unsupported/Unkown border type";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user