perf_intelligent_scissors.cpp 873 B

12345678910111213141516171819202122232425262728293031323334
  1. // This file is part of OpenCV project.
  2. // It is subject to the license terms in the LICENSE file found in the top-level directory
  3. // of this distribution and at http://opencv.org/license.html.
  4. #include "perf_precomp.hpp"
  5. namespace opencv_test { namespace {
  6. typedef perf::TestBaseWithParam<int> TestIntelligentScissorsMB;
  7. PERF_TEST_P(TestIntelligentScissorsMB, buildMap, testing::Values( IMREAD_GRAYSCALE, IMREAD_COLOR ))
  8. {
  9. const int flags = GetParam();
  10. const Mat image = imread(findDataFile("cv/shared/lena.png"), flags);
  11. ASSERT_TRUE(!image.empty());
  12. const Point source_point(275, 63);
  13. segmentation::IntelligentScissorsMB tool;
  14. tool.applyImage(image);
  15. PERF_SAMPLE_BEGIN()
  16. for (size_t idx = 1; idx <= 100; ++idx)
  17. {
  18. tool.buildMap(source_point);
  19. }
  20. PERF_SAMPLE_END()
  21. SANITY_CHECK_NOTHING();
  22. }
  23. }} // namespace