Performance test for bounding rect estimation
authorVitaly Tuzov <terfendail@mediana.jetos.com>
Fri, 18 Jan 2019 11:59:03 +0000 (14:59 +0300)
committerVitaly Tuzov <terfendail@mediana.jetos.com>
Fri, 18 Jan 2019 12:50:21 +0000 (15:50 +0300)
modules/imgproc/perf/perf_contours.cpp

index d3a70cf..bc8b530 100644 (file)
@@ -84,4 +84,26 @@ PERF_TEST_P(TestFindContoursFF, findContours,
     SANITY_CHECK_NOTHING();
 }
 
+typedef TestBaseWithParam< tuple<MatDepth, int> > TestBoundingRect;
+
+PERF_TEST_P(TestBoundingRect, BoundingRect,
+    Combine(
+        testing::Values(CV_32S, CV_32F), // points type
+        Values(400, 511, 1000, 10000, 100000) // points count
+    )
+)
+
+{
+    int ptType = get<0>(GetParam());
+    int n = get<1>(GetParam());
+
+    Mat pts(n, 2, ptType);
+    declare.in(pts, WARMUP_RNG);
+
+    cv::Rect rect;
+    TEST_CYCLE() rect = boundingRect(pts);
+
+    SANITY_CHECK_NOTHING();
+}
+
 } } // namespace