C++ OpenCV 3.0 中缺少非自由模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27418668/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 20:47:37  来源:igfitidea点击:

Nonfree module is missing in OpenCV 3.0

c++opencvsurf

提问by Chaitanya Uttarwar

I have built the openCV 3.0 alpha version from source with support for CUDA and TBB. Now, I want to do feature detection and feature matching using SURF algorithm. SurfFeatureDetector is present in the include file

我已经从源代码构建了 openCV 3.0 alpha 版本,支持 CUDA 和 TBB。现在,我想使用 SURF 算法进行特征检测和特征匹配。SurfFeatureDetector 存在于包含文件中

opencv2/nonfree/features2d.hpp & opencv2/nonfree/features2d.hpp

opencv2/nonfree/features2d.hpp & opencv2/nonfree/features2d.hpp

But the module nonfree is missing in this version of openCV. I tried checking the opencv forums at answers.opencv.org but the site is under construction.

但是这个版本的 openCV 中缺少 nonfree 模块。我尝试在 answers.opencv.org 上查看 opencv 论坛,但该站点正在建设中。

How to use the non free modules?

如何使用非免费模块?

回答by berak

with opencv3.0, SURF/SIFT and some other things have been moved to a seperate opencv_contrib repo.

使用 opencv3.0,SURF/SIFT 和其他一些东西已移至单独的opencv_contrib repo

you will have to download that, add it to your main opencv cmake settings (please look at the readme there), and rerun cmake/make.

您必须下载它,将其添加到您的主要 opencv cmake 设置中(请查看那里的自述文件),然后重新运行 cmake/make。

then:

然后:

#include "opencv2/xfeatures2d.hpp"

...
Ptr<SIFT> sift = cv::xfeatures2d::SIFT::create(...);
sift->detect(...);

回答by Ignacio Vizzo

You could also install all the non-free stuff from this PPA

您还可以安装此 PPA 中的所有非免费内容

sudo add-apt-repository ppa:ignaciovizzo/opencv3-nonfree
sudo apt-get update
sudo apt install libopencv-dev