Path: blob/master/modules/imgproc/perf/opencl/perf_gftt.cpp
16344 views
///////////////////////////////////////////////////////////////////////////////////////1//2// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.3//4// By downloading, copying, installing or using the software you agree to this license.5// If you do not agree to this license, do not download, install,6// copy or use the software.7//8//9// License Agreement10// For Open Source Computer Vision Library11// Copyright (C) 2010-2012, Multicoreware, Inc., all rights reserved.12// Copyright (C) 2010-2012, Institute Of Software Chinese Academy Of Science, all rights reserved.13// Copyright (C) 2010-2012, Advanced Micro Devices, Inc., all rights reserved.14// Third party copyrights are property of their respective owners.15//16//17// Redistribution and use in source and binary forms, with or without modification,18// are permitted provided that the following conditions are met:19//20// * Redistribution's of source code must retain the above copyright notice,21// this list of conditions and the following disclaimer.22//23// * Redistribution's in binary form must reproduce the above copyright notice,24// this list of conditions and the following disclaimer in the documentation25// and/or other materials provided with the distribution.26//27// * The name of the copyright holders may not be used to endorse or promote products28// derived from this software without specific prior written permission.29//30// This software is provided by the copyright holders and contributors "as is" and31// any express or implied warranties, including, but not limited to, the implied32// warranties of merchantability and fitness for a particular purpose are disclaimed.33// In no event shall the Intel Corporation or contributors be liable for any direct,34// indirect, incidental, special, exemplary, or consequential damages35// (including, but not limited to, procurement of substitute goods or services;36// loss of use, data, or profits; or business interruption) however caused37// and on any theory of liability, whether in contract, strict liability,38// or tort (including negligence or otherwise) arising in any way out of39// the use of this software, even if advised of the possibility of such damage.40//41//M*/4243#include "../perf_precomp.hpp"44#include "opencv2/ts/ocl_perf.hpp"4546#include <sstream>4748#ifdef HAVE_OPENCL4950namespace opencv_test {51namespace ocl {5253//////////////////////////// GoodFeaturesToTrack //////////////////////////5455typedef tuple<String, double, bool> GoodFeaturesToTrackParams;56typedef TestBaseWithParam<GoodFeaturesToTrackParams> GoodFeaturesToTrackFixture;5758OCL_PERF_TEST_P(GoodFeaturesToTrackFixture, GoodFeaturesToTrack,59::testing::Combine(OCL_PERF_ENUM(String("gpu/opticalflow/rubberwhale1.png")),60OCL_PERF_ENUM(0.0, 3.0), Bool()))61{62GoodFeaturesToTrackParams params = GetParam();63const String fileName = get<0>(params);64const double minDistance = get<1>(params), qualityLevel = 0.01;65const bool harrisDetector = get<2>(params);66const int maxCorners = 1000;6768Mat img = imread(getDataPath(fileName), cv::IMREAD_GRAYSCALE);69ASSERT_FALSE(img.empty()) << "could not load " << fileName;7071checkDeviceMaxMemoryAllocSize(img.size(), img.type());7273UMat src(img.size(), img.type()), dst(1, maxCorners, CV_32FC2);74img.copyTo(src);7576declare.in(src, WARMUP_READ).out(dst);7778OCL_TEST_CYCLE() cv::goodFeaturesToTrack(src, dst, maxCorners, qualityLevel,79minDistance, noArray(), 3, 3, harrisDetector, 0.04);8081SANITY_CHECK(dst);82}8384} } // namespace opencv_test::ocl8586#endif878889