本文整理汇总了C++中cv::gpu::DeviceInfo类的典型用法代码示例。如果您正苦于以下问题:C++ DeviceInfo类的具体用法?C++ DeviceInfo怎么用?C++ DeviceInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DeviceInfo类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GPU_PERF_TEST
GPU_PERF_TEST(HoughLines, cv::gpu::DeviceInfo, cv::Size, DoSort)
{
declare.time(30.0);
const cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
const cv::Size size = GET_PARAM(1);
const bool doSort = GET_PARAM(2);
const float rho = 1.0f;
const float theta = CV_PI / 180.0f;
const int threshold = 300;
cv::RNG rng(123456789);
cv::Mat src(size, CV_8UC1, cv::Scalar::all(0));
const int numLines = rng.uniform(500, 2000);
for (int i = 0; i < numLines; ++i)
{
cv::Point p1(rng.uniform(0, src.cols), rng.uniform(0, src.rows));
cv::Point p2(rng.uniform(0, src.cols), rng.uniform(0, src.rows));
cv::line(src, p1, p2, cv::Scalar::all(255), 2);
}
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_lines;
cv::gpu::GpuMat d_accum;
cv::gpu::GpuMat d_buf;
cv::gpu::HoughLines(d_src, d_lines, d_accum, d_buf, rho, theta, threshold, doSort);
TEST_CYCLE()
{
cv::gpu::HoughLines(d_src, d_lines, d_accum, d_buf, rho, theta, threshold, doSort);
}
}
开发者ID:vpas,项目名称:opencv,代码行数:36,代码来源:perf_imgproc.cpp
示例2: supportFeature
bool supportFeature(const cv::gpu::DeviceInfo& info, cv::gpu::FeatureSet feature)
{
return cv::gpu::TargetArchs::builtWith(feature) && info.supports(feature);
}
开发者ID:JaehyunAhn,项目名称:Basic_OpenCV_utilization,代码行数:4,代码来源:test_gpu_base.cpp
示例3: SetUp
virtual void SetUp()
{
devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
img = readImage(GET_PARAM(1), cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(img.empty());
}
开发者ID:4auka,项目名称:opencv,代码行数:8,代码来源:test_objdetect.cpp
示例4: SetUp
virtual void SetUp()
{
devInfo = std::tr1::get<0>(GetParam());
type = std::tr1::get<1>(GetParam());
cv::gpu::setDevice(devInfo.deviceID());
cv::RNG& rng = cvtest::TS::ptr()->get_rng();
size = cv::Size(rng.uniform(100, 200), rng.uniform(100, 200));
mat1 = cvtest::randomMat(rng, size, type, 1, 16, false);
mat2 = cvtest::randomMat(rng, size, type, 1, 16, false);
}
开发者ID:coapp-packages,项目名称:opencv,代码行数:14,代码来源:test_arithm.cpp
示例5: SetUp
virtual void SetUp()
{
devInfo = GetParam();
cv::gpu::setDevice(devInfo.deviceID());
img_l = readImage("stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE);
img_r = readImage("stereobm/aloe-R.png", CV_LOAD_IMAGE_GRAYSCALE);
img_template = readImage("stereobm/aloe-disp.png", CV_LOAD_IMAGE_GRAYSCALE);
ASSERT_FALSE(img_l.empty());
ASSERT_FALSE(img_r.empty());
ASSERT_FALSE(img_template.empty());
}
开发者ID:dgiunchi,项目名称:OpenCV,代码行数:14,代码来源:test_calib3d.cpp
示例6: SetUp
virtual void SetUp()
{
devInfo = GetParam();
cv::gpu::setDevice(devInfo.deviceID());
image = readImage("features2d/aloe.png", CV_LOAD_IMAGE_GRAYSCALE);
ASSERT_FALSE(image.empty());
mask = cv::Mat(image.size(), CV_8UC1, cv::Scalar::all(1));
mask(cv::Range(0, image.rows / 2), cv::Range(0, image.cols / 2)).setTo(cv::Scalar::all(0));
cv::SURF fdetector_gold; fdetector_gold.extended = false;
fdetector_gold(image, mask, keypoints_gold, descriptors_gold);
}
开发者ID:dgiunchi,项目名称:OpenCV,代码行数:15,代码来源:test_features2d.cpp
示例7: SetUp
virtual void SetUp()
{
devInfo = GetParam();
cv::gpu::setDevice(devInfo.deviceID());
}
开发者ID:heroacool,项目名称:OpenCVMirror,代码行数:6,代码来源:test_hog.cpp
注:本文中的cv::gpu::DeviceInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论