1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2021-01-25 22:34:41 +00:00
9 changed files with 419 additions and 189 deletions
@@ -78,6 +78,41 @@ String testOverloadResolution(const Rect& rect)
rect.width, rect.height);
}
CV_WRAP static inline
String dumpRect(const Rect& argument)
{
return format("rect: (x=%d, y=%d, w=%d, h=%d)", argument.x, argument.y,
argument.width, argument.height);
}
CV_WRAP static inline
String dumpTermCriteria(const TermCriteria& argument)
{
return format("term_criteria: (type=%d, max_count=%d, epsilon=%lf",
argument.type, argument.maxCount, argument.epsilon);
}
CV_WRAP static inline
String dumpRotatedRect(const RotatedRect& argument)
{
return format("rotated_rect: (c_x=%f, c_y=%f, w=%f, h=%f, a=%f)",
argument.center.x, argument.center.y, argument.size.width,
argument.size.height, argument.angle);
}
CV_WRAP static inline
String dumpRange(const Range& argument)
{
if (argument == Range::all())
{
return "range: all";
}
else
{
return format("range: (s=%d, e=%d)", argument.start, argument.end);
}
}
CV_WRAP static inline
AsyncArray testAsyncArray(InputArray argument)
{
+5 -5
View File
@@ -1149,14 +1149,14 @@ void OpenCLExecutionContext::release()
}
// true if we have initialized OpenCL subsystem with available platforms
static bool g_isOpenCLActivated = false;
static bool g_isOpenCLInitialized = false;
static bool g_isOpenCLAvailable = false;
bool haveOpenCL()
{
CV_TRACE_FUNCTION();
static bool g_isOpenCLInitialized = false;
static bool g_isOpenCLAvailable = false;
if (!g_isOpenCLInitialized)
{
@@ -1178,7 +1178,7 @@ bool haveOpenCL()
{
cl_uint n = 0;
g_isOpenCLAvailable = ::clGetPlatformIDs(0, NULL, &n) == CL_SUCCESS;
g_isOpenCLActivated = n > 0;
g_isOpenCLAvailable &= n > 0;
CV_LOG_INFO(NULL, "OpenCL: found " << n << " platforms");
}
catch (...)
@@ -1214,7 +1214,7 @@ bool useOpenCL()
bool isOpenCLActivated()
{
if (!g_isOpenCLActivated)
if (!g_isOpenCLAvailable)
return false; // prevent unnecessary OpenCL activation via useOpenCL()->haveOpenCL() calls
return useOpenCL();
}