1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

softcascade: remove device dependency on gpu

This commit is contained in:
marina.kolpakova
2013-03-03 16:27:49 +04:00
parent 6daf17f974
commit 3c8e66d580
9 changed files with 77 additions and 34 deletions
@@ -43,6 +43,8 @@
#include "test_precomp.hpp"
#include "opencv2/core/gpumat.hpp"
#ifdef HAVE_CUDA
using std::tr1::get;
// show detection results on input image with cv::imshow
@@ -210,7 +212,7 @@ TEST_P(SCascadeTestRoi, Detect)
}
INSTANTIATE_TEST_CASE_P(cuda_accelerated, SCascadeTestRoi, testing::Combine(
testing::ValuesIn(DeviceManager::instance().values()),
ALL_DEVICES,
testing::Values(std::string("cascades/inria_caltech-17.01.2013.xml"),
std::string("cascades/sc_cvpr_2012_to_opencv_new_format.xml")),
testing::Values(std::string("images/image_00000000_0.png")),
@@ -309,4 +311,6 @@ TEST_P(SCascadeTestAll, detectStream)
INSTANTIATE_TEST_CASE_P(cuda_accelerated, SCascadeTestAll, testing::Combine( ALL_DEVICES,
testing::Values(Fixture("cascades/inria_caltech-17.01.2013.xml", 7),
Fixture("cascades/sc_cvpr_2012_to_opencv_new_format.xml", 1291))));
Fixture("cascades/sc_cvpr_2012_to_opencv_new_format.xml", 1291))));
#endif
+6 -3
View File
@@ -52,6 +52,8 @@
//! return true if device supports specified feature and gpu module was built with support the feature.
bool supportFeature(const cv::gpu::DeviceInfo& info, cv::gpu::FeatureSet feature);
#if defined(HAVE_CUDA)
class DeviceManager
{
public:
@@ -66,8 +68,9 @@ private:
std::vector<cv::gpu::DeviceInfo> devices_;
DeviceManager() {loadAll();}
};
#define ALL_DEVICES testing::ValuesIn(DeviceManager::instance().values())
# define ALL_DEVICES testing::ValuesIn(DeviceManager::instance().values())
#else
# define ALL_DEVICES testing::ValuesIn(std::vector<cv::gpu::DeviceInfo>())
#endif
#endif // __OPENCV_GPU_TEST_UTILITY_HPP__