Merge pull request #18652 from OrestChura:oc/morphologyEx

[G-API]: morphologyEx() Standard Kernel Implementation

* cv::gapi::morphologyEx() kernel
 - implemented (without separate 3x3 version)
 - tests added: check only different operations, not kernels/borders

* Address comments: add `const` where needed

* Replaced fundamental tyeps -> enums where needed
 - added operator<< overload for cv::MorphTypes for tests output
This commit is contained in:
Orest Chura
2020-11-10 21:57:52 +03:00
committed by GitHub
parent e12adcdf08
commit 5f1ca33c6f
7 changed files with 126 additions and 1 deletions

View File

@@ -848,6 +848,25 @@ inline std::ostream& operator<<(std::ostream& os, NormTypes op)
#undef CASE
return os;
}
inline std::ostream& operator<<(std::ostream& os, MorphTypes op)
{
#define CASE(v) case MorphTypes::v: os << #v; break
switch (op)
{
CASE(MORPH_ERODE);
CASE(MORPH_DILATE);
CASE(MORPH_OPEN);
CASE(MORPH_CLOSE);
CASE(MORPH_GRADIENT);
CASE(MORPH_TOPHAT);
CASE(MORPH_BLACKHAT);
CASE(MORPH_HITMISS);
default: GAPI_Assert(false && "unknown MorphTypes value");
}
#undef CASE
return os;
}
} // namespace cv
#endif //OPENCV_GAPI_TESTS_COMMON_HPP