首页 > 代码库 > ==原创==Ubuntu14.04安装OPENCV3.0流程及遇到的问题
==原创==Ubuntu14.04安装OPENCV3.0流程及遇到的问题
Ubuntu14.04安装OPENCV3.0流程及遇到的问题
tianbing010@126.com
http://www.cnblogs.com/mcjj
作者:马春杰杰
在opencv 根目录找到opencvroot/samples/gpu/performance/tests.cpp
修改成如下代码。
TEST(ORB)
{
Mat src = http://www.mamicode.com/imread(abspath("../data/aloeL.jpg"), IMREAD_GRAYSCALE);
if (src.empty()) throw runtime_error("can‘t open ../data/aloeL.jpg");
//ORB orb(4000);
Ptr<ORB> orb = ORB::create(4000,1.2f,8,31,0,2,ORB::HARRIS_SCORE,31,20);
vector<KeyPoint> keypoints;
Mat descriptors;
orb->detectAndCompute(src, Mat(), keypoints, descriptors);
//orb(src, Mat(), keypoints, descriptors);
CPU_ON;
//orb(src, Mat(), keypoints, descriptors);
orb->detectAndCompute(src, Mat(), keypoints, descriptors);
CPU_OFF;
cuda::ORB_CUDA d_orb;
cuda::GpuMat d_src(src);
cuda::GpuMat d_keypoints;
cuda::GpuMat d_descriptors;
d_orb(d_src, cuda::GpuMat(), d_keypoints, d_descriptors);
CUDA_ON;
d_orb(d_src, cuda::GpuMat(), d_keypoints, d_descriptors);
CUDA_OFF;
}
==原创==Ubuntu14.04安装OPENCV3.0流程及遇到的问题